Home » Coding » Python » Pil image module, "mode" bug..
Pil image module, "mode" bug.. [message #15670] Sun, 07 October 2007 09:03 Go to next message
besturk  is currently offline besturk
Messages: 14
Registered: October 2007
Junior Member
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
Re: Pil image module, "mode" bug.. [message #15680 is a reply to message #15670 ] Sun, 07 October 2007 09:47 Go to previous messageGo to next message
Michal Bozon  is currently offline Michal Bozon
Messages: 6
Registered: September 2007
Junior Member
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.
Re: Pil image module, "mode" bug.. [message #15733 is a reply to message #15680 ] Sun, 07 October 2007 12:02 Go to previous messageGo to next message
besturk  is currently offline besturk
Messages: 14
Registered: October 2007
Junior Member
On Oct 7, 4:47 pm, Michal Bozon <boz...@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)
Re: Pil image module, "mode" bug.. [message #15770 is a reply to message #15733 ] Sun, 07 October 2007 13:17 Go to previous message
Michal Bozon  is currently offline Michal Bozon
Messages: 6
Registered: September 2007
Junior Member
On Sun, 07 Oct 2007 09:02:09 -0700, Abandoned wrote:

> On Oct 7, 4:47 pm, Michal Bozon <boz...@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
Previous Topic:newbie swig c++ to python
Next Topic:How to create a file on users XP desktop
Goto Forum:
  


Current Time: Fri May 16 02:24:41 EDT 2008

Total time taken to generate the page: 0.08781 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software