[Image-SIG] Newbie, questions on saving PNG

Lino Mastrodomenico l.mastrodomenico at gmail.com
Sat Feb 16 00:52:33 CET 2008

2008/2/14, Nuttall, Brandon C <bnuttall at uky.edu>:
> My question is how to specify the PNG optimize parameter? The documentation
> for the save method says
>             Im.save(outfile,format,options)
> The PNG section of the documentation says "optimize" can be specified for
> the save method. It appears that this is the value of a keyword argument.
> However, if I try im.save(outfile,format,"optimize"), the code fails with a
> wrong number of arguments message.

Try something like this:

im.save(outfile, 'png', optimize=True)

Or, if outfile ends with ".png", you can simply use:

im.save(outfile, optimize=True)

Hope this helps.

Lino Mastrodomenico
E-mail: l.mastrodomenico at gmail.com

More information about the Image-SIG mailing list