[Image-SIG] Does PIL ImageDraw create shape objects or stain pixels?

Jeff Brantley jsbmsu at gmail.com
Wed Oct 26 23:49:33 CEST 2011


Hi,

I am working on code to draw tens or hundreds of thousands of squares and
connecting lines using the tkinter canvas, and it is incredibly slow
because, as I understand it, the canvas keeps the individual shape objects
around in memory and tests for the current visible bounding box to touch
them, and redraws them.

I am wondering whether PIL's ImageDraw module behaves in this manner, or
whether it instead just paints the shapes onto a raw pixel buffer,
effectively "staining" the pixels, rather than holding onto thousands of
identical objects. I assume that this would be much faster if it is the
case.

Thanks for your help,
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20111026/d106b5dd/attachment-0001.html>


More information about the Image-SIG mailing list