[Image-SIG] A possible bug in converting palletized images to QImage

Christopher Barker Chris.Barker at noaa.gov
Mon Jan 4 18:42:39 CET 2010


Mauricio Muñoz Lucero wrote:
> I am making an image converter using PIL 1.1.7 and PyQt 4.6 for the gui.
> 
> Everything goes perfect, except when i try to convert an image in "P"
> mode (8 bit pixels and using a colour palette) to QImage, using the
> ImageQt module.
...
> Is it really a bug or am i using incorrectly the ImageQt module?

That would be a question for a QT list.

But another option is to convert the image form palette to RGB (or RGBA0 
with PIL instead. Something like:

im = PIL.Image(the_image_file)
im = im.convert('RGB')

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Image-SIG mailing list