[Image-SIG] Re: Optimizing PNGs in PIL

Fredrik Lundh fredrik at pythonware.com
Fri Nov 5 10:33:10 CET 2004

Mikael Olofsson wrote:

> I've been playing around with PIL for a while, and I am quite pleased so far, but I have a small 
> problem. I can save an image using
>    im.save('c:/foo/bar/baz.png')
> as the PIL Handbook at
>    http://www.pythonware.com/library/pil/handbook/index.htm
> says, and it also states that I can give options by supplying a named argument called options.

you're reading the description too literally; the following part

    "Keyword options can be used to provide additional instructions to the
    writer. If a writer doesn't recognise an option, it is silently ignored. The
    available options are described later in this handbook."

attemps to imply that options are given as keyword arguments, not as a
keyword argument named "options".  or in other words,

    im.save('c:/foo/bar/baz.png', options='optimize')

should be

    im.save('c:/foo/bar/baz.png', optimize=1)


More information about the Image-SIG mailing list