[Image-SIG] Convert Function and Palette Mode

Takekun Sato too@pk.highway.ne.jp
Fri, 16 Mar 2001 03:20:22 +0900


Thanks Walter !

I appreciate your advice.

Images converted to "PaletteMode" using
keyword arguments("palette=Image.ADAPTIVE")
are greatly enhanced than those images produced
without such palette option.

Now, another question came into my mind.

Is there anyway to set a palette which is used
to convert an image to "PaletteMode" ?

I mean, is it possible to convert images not with
automatically generated palette but with my private color palette ?


"Walter Dörwald" wrote:

> On 15.03.01 at 05:56 Takekun Sato wrote:
>
> > It seems that 'im.convert("P")' always converts
> > an image with 'Web-Color'.
> >
> > So, resultant image is surely made up of 216 colors
> > such as #333333,#336699,#3366CC,...
> >
> > How can I change the behavior to make the 'convert()'
> > to use appropriate color palette other than 'Web-Color'?
>
> Try im.convert("P", colors=32, palette=Image.ADAPTIVE)
> or something like that.