[Image-SIG] RGBA support in TIFF imgaes...

Fredrik Lundh fredrik@pythonware.com
Wed, 24 Nov 1999 14:52:24 +0100


Kevin Cazabon wrote:
> I'm just wondering if there's any reason that RGBA images aren't properly supported
> in the TIFF reader... I realize that the documentation doesn't mention RGBA for TIFF,
> however the images do load without error (they load as RGBX), but the alpha channel
> is messed up.

> Is it supposed to work, or is there something that needs to be changed in the TIFF
> plugin?

RGBA is supposed to work, but only for TIFF files
where the fourth layer is marked as an extra
transparency layer (the extra samples tag should
contain an "unassociated alpha" layer and nothing
else)

in your case, it looks like the file contains four
layers, but that the fourth layer is marked as
"unspecified".  (what did you use to generate
those files?)

a quick hack is to change the OPEN_INFO
table to look like:

#    (2, 1, (8,8,8,8), (0,)): ("RGBX", "RGBX"),
    (2, 1, (8,8,8,8), (0,)): ("RGBA", "RGBA"),
    (2, 1, (8,8,8,8), (2,)): ("RGBA", "RGBA"),

</F>