Image.putpalette(Colors)?
Oliver Albrecht
550283447739-0001 at t-online.de
Wed May 18 18:31:10 EDT 2005
I think in this Example is an fault
lut has the sequence from "im" but not from "lut.putdata(range(256))"
##Getting the Palette Contents Using Resize/Convert
assert im.mode == "P"
lut = im.resize((256, 1))
lut.putdata(range(256))
lut = im.convert("RGB").getdata()
^^
# lut now contains a sequence of (r, g, b) tuples
Fredrik Lundh wrote:
> here's one of the first google hits for "PIL putpalette":
>
> http://effbot.org/zone/pil-pseudocolor.htm
More information about the Python-list
mailing list