[Image-SIG] format is None after convert('RGB')

Fredrik Lundh fredrik at pythonware.com
Sat Jan 19 12:16:51 CET 2008

Vitaliyi wrote:

> from PIL import Image
> img = Image.open('/tmp/tst.png')
> #after following conversion format is unknown. is it correct ?
> if img.mode != 'RGB':
>     img = img.convert('RGB')
> P.S. I'm using python-imaging 1.1.6-1 (from debian)

the "format" attribute only reflects the immediate source.  like most 
PIL operations, "convert" returns a *new* image object.


More information about the Image-SIG mailing list