Pil Image update or refresh

Viewed 13

I am plotting xy-graphs in a loop into a PIL image (using Image, ImageDraw, ImageShow) and would like to update the image output on the screen once every new iteration with a new xy-point has been calculated.

When including image.show() in the loop a new window will be opened for output every iteration.

When placing the image.show() after the loop just the complete graph will be plotted instead of the evolving plot.

How can I force the output to update or refresh the same first window with every new xy-point instead opening tons of new windows?

:- Thanks

    from PIL import Image, ImageDraw, ImageShow
    size_x , size_y = 1000 , 1000
    im = Image.new('RGB', (size_x, size_y), (0,0,0))
    draw = ImageDraw.Draw(im)
    for i in range (1,100)
           n_Pic_x = i
           n_Pic_y = i*i
           draw.point([n_Pic_x,n_Pic_y],((122),(122),(122)))
           im.show()

# im.show() ???
0 Answers
Related