SV: PIL - gif image
Erik Max Francis
max at alcyone.com
Thu Jan 9 19:14:41 EST 2003
Simon Dahlbacka wrote:
> yes, it was just how to get access to what was in the .palette
> attribute I
> wasn't sure about.. but anyhow, I did like this..
>
> def indextoRGB(self,im,index):
> return (ord(im.palette.data[3*index]),
> ord(im.palette.data[3*index+1]),
> ord(im.palette.data[3*index+2]))
>
> ..but maybe there's an easier way?
To be honest, I'm not sure. The PIL Handbook seems to be lacking
documentation on the ImagePalette class.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ I'm paranoid. But am I paranoid enough?
\__/ Louis Wu
Fauxident / http://www.alcyone.com/pyos/fauxident/
A "faux" ident daemon in Python.
More information about the Python-list
mailing list