def display_cells_on_img(
    image: Image.Image,
    cells,
    show_cell_types: Literal["all", "headers", "rows", "columns"] = "all",
    use_blank_image: bool = False,
    min_cell_confidence: float = 0.95,
) -> None:
    """
    Used for debugging to visualize the detected cells on the cropped table image.
    """
    try:
        from IPython.display import display  # type: ignore
        from PIL import ImageDraw  # type: ignore
    except ImportError:
        logging.error(
            "IPython or PIL is not installed to display cells on the image. Skipping"
        )
        return

    cropped_table_visualized = image.copy()
    if use_blank_image:
        cropped_table_visualized = Image.new("RGB", image.size, color="white")
    draw = ImageDraw.Draw(cropped_table_visualized)

    for cell in cells:
        if cell.confidence < min_cell_confidence:
            continue

        if show_cell_types == "headers" and not cell.is_header:
            continue
        elif show_cell_types == "rows" and not cell.is_row:
            continue
        elif show_cell_types == "columns" and not cell.is_column:
            continue

        draw.rectangle(cell.bbox, outline="red")

    display(cropped_table_visualized)

    Used for debugging to visualize the detected cells on the cropped table image.
    
src/openparse/tables/utils.py