[Python] drawing a line on an image with PIL

Discussão em 'Python' iniciado por Stack, Agosto 10, 2025.

  1. Stack

    Stack Membro Participativo

    I want to draw a line and show it. assume I have a PIL image.

    draw = ImageDraw.Draw(pilImage)
    draw.line((100,200, 150,300), fill=128)


    How can I show the image? Before drawing the line I could do:

    imshow(pilImage)


    but imshow(draw) does not show the image.

    How do I convert this back to a PIL image?

    Continue reading...

Compartilhe esta Página