AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

2005.03.11 15:36 "[Tiff] unassociated v associated alpha", by Chris Losinger

        just curious...

in tif_getimage.c, the putRGBUAcontig8bittile function (8-bit packed samples => RGBA w/ unassociated alpha) appears to be treating the alpha data as if it's been pre-multiplied:

        ...
            a = pp[3];

            r = (pp[0] * a) / 255;
            g = (pp[1] * a) / 255;
            b = (pp[2] * a) / 255;
            *cp++ = PACK4(r,g,b,a);

        ...

while the putRGBAAcontig8bittile function (8-bit packed samples => RGBA w/ associated alpha) simply copies the pixel data to the output, without doing any alpha calculations.

are these reversed? seems to me you'd want to multiply the "associated" data, but copy the "unassociated" data.

        or, am I confused...? :)

        -c

__________________________
Chris Losinger
Smaller Animals Software, Inc.
http://www.smalleranimals.com