[Image-SIG] Re: GIF paste / mask question

Fredrik Lundh fredrik at pythonware.com
Wed Jun 25 23:06:01 EDT 2003

Dave Kelly wrote:

> So say my info['transparency'] value is 56 (arbitrarily).  How would I
> generate a mask out of my image so that when I paste, anything pixels
> that map to 56 in the palette table are not pasted?

here's one way to do it:

    table = [255]*256
    table[56] = 0 # don't want this one
    mask = image.point(table, "1") # make a bilevel mask


More information about the Image-SIG mailing list