[Image-SIG] How to tell whether/what is the alpha color in an indexed image file ?

Ray Pasco pascor at hotpop.com
Thu Mar 24 23:26:16 CET 2005


If a PNG image with an alpha layer is opened, the im.mode will be "RGBA".
However, if an indexed PNG or GIF is opened with an alpha color set,
the mode is simply "P" (no "A" as in "PA").

1) How can I get PIL to tell me if and what is the "alpha" color index ?

2) When an RGBA image is converted to an indexed image, does PIL record
the occurance in some manner that any pixels had alpha values set to 
less than 255 ?

Thanks,
Ray Pasco




More information about the Image-SIG mailing list