Pil image module, "mode" bug..

Diez B. Roggisch deets at nospam.web.de
Mon Oct 8 15:10:54 CEST 2007


oruccim at gmail.com wrote:

> On Oct 7, 8:17 pm, Michal Bozon <boz... at vscht.cz> wrote:
>> On Sun, 07 Oct 2007 09:02:09 -0700, Abandoned wrote:
>> > On Oct 7, 4:47 pm, Michal Bozon <boz... at vscht.cz> wrote:
>> >> On Sun, 07 Oct 2007 06:03:06 -0700, Abandoned wrote:
>> >> > Hi..
>> >> > I find the picture color with:
>> >> > im=Image.open("/%s" %name)
>> >> > color=im.mode   #p=black & beyaz rgb=color L=grey
>>
>> >> > This usually work true but in these pictures:
>> >> >http://malatya.meb.gov.tr/images/alt/ilsis_logo.gif
>> >> >http://malatya.meb.gov.tr/images/meb.gif
>>
>> >> > Say me P (black&white) but these pictures are color..
>>
>> >> > What is the reason of this ?
>>
>> >> > I'm sorry my bad english
>>
>> >> P does mean palette, black&white is a special case of palette, with
>> >> two colors.
>>
>> > How can i understand the picture color ? (black &white or color or
>> > grey)
>>
>> If you know how to work with RGB images, you can convert the image
>> from the palette mode easily:
>>
>> img2 = img.convert(mode='RGB')
>>
>> Anyway, always is helpful to read the tutorial or basic documentation..
>> ;)
>>
>>  MB- Hide quoted text -
>>
>> - Show quoted text -
> 
> no no no this is not professionalism

What professionalism? This isn't a paid support service, you are aware of
that?

> are there anybody who know that

Who knows what? That PIL has e.g. a histogram-function that delivers what
you need (after some thinking, I suggest you try and see at it's output
with various source images)

Diez



More information about the Python-list mailing list