Search code examples
pythonpython-imaging-libraryfractals

Draw multiple PIL.Image in python


I have a python funtion that draws a Fractal to a PIL.Image, but i want to vary the parameters of the function in realtime and to plot it to the screen. How can i plot the image and keep updating the ploted image each time the parametes of the function vary


Solution

  • Use matplotlib, wxPython, PyQt, PyGame, Tk/TCL or some other lib to display the image.

    Draw as many images as you need, whenever you need, using any lib you need, and then display it on a screen using one of above mentioned or some other GUI libs.

    If you are working with plots and math functions, matplotlib will help you most. You might even totally use it, forgoing PIL completely.

    If you want to stick to PIL only, you will have to write your own show() function, that will use some external imaging software which will seemlessly change to show another image when you send it. Perhaps Irfan View would do.