aggdraw for PIL

Fredrik Lundh fredrik at pythonware.com
Wed Aug 31 14:15:15 EDT 2005


Adam Endicott wrote:

> Does anyone know anything about the aggdraw module for PIL? I think I
> would like to use it because I need to do some drawing with
> semi-transparent pen styles (I'm simulating using a highlighter). It
> seems to be working great, but I think I'm running into a memory leak
> that's noted in the documentation at
> http://effbot.org/zone/pythondoc-aggdraw.htm#aggdraw.Draw-class
>
> "Note: The Draw(im) form leaks memory in aggdraw 1.1b1 and earlier.
> Don't use this form in long-running program that creates multiple
> drawings. The memory leak has been fixed in release 1.1b2."

as a workaround, you can use the original constructor syntax instead,
together with fromstring/tostring:

    d = Draw(im.mode, im.size)
    d.fromstring(im.tostring())

    # draw your stuff

    im.fromstring(d.tostring())

> Sounds good, except I can't find 1.1b2 anywhere. Is it not released
> yet? If so, does anyone know when it might be released?

it has been delayed, but it should appear within a week or two.

</F> 






More information about the Python-list mailing list