available formats and params for Image.save()

News123 news123 at free.fr
Thu Jul 23 05:56:45 EDT 2009


Somehow I have difficulties reading the documentation for PIL (Image)

Is there an easy way to know which formats are supported and what their
names are?

Is there an easy way to know which parameters are supported by
Image.save(). How can I list them where are they documented?

Somehow I consider the documentation to be a little weak on this points.
all the documentation says (at least where I looked) is:

>     class Image
>      |  Methods defined here:
> . . .
>  save(self, fp, format=None, **params)
>      |      Save image to file or stream

In order to find out how the format name for a .jpg file I did following:

import Image
img = Image.open("afile.jpg")
print img.format

Then I saw, that the result was 'JPEG' and not 'JPG' as I tried first

I'm at a complete loss at finding out what parameters the save function
accepts for saving a JPG file or a PNG file

Is there an easy way of finding this in any doc or do I have to dive
into the sources.

If there's no easy way:
Wouldn't a better documentation increase the 'user experience'?

Thanks in advance for any pointers


More information about the Python-list mailing list