| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
Thread2009.04.27 20:00 "Re: Question regarding unassociated alpha", by Chris CoxUnassociated alpha should never be premultiplied - it is not associated with
the color channels.
Only assoicated alpha should be premultiplied.
Chris
________________________________________
From: tiff-bounces@lists.maptools.org [tiff-bounces@lists.maptools.org] On
Behalf Of Amir Ebrahimi [amir@unity3d.com]
Sent: Monday, April 27, 2009 12:49 PM
To: tiff@lists.maptools.org
Subject: [Tiff] Question regarding unassociated alpha
I'm using libtiff via FreeImage in our development tool: Unity.
We've had an image support regression with TIFF files after switching
to FreeImage/libtiff from the QuickTime SDK. A file with unassociated
alpha still seems to be getting pre-multiplied in with the RGB
channels. Is this by design? I'd like to get the TIFF file with RGBA
channels intact without it being pre-multiplied. If the image had
associated alpha, then it would make sense that it was pre-multiplied,
however, that isn't the case.
In libtiff (v3.9.0) line 268:269 has these comments:
case EXTRASAMPLE_ASSOCALPHA: /* data is pre-multiplied */
case EXTRASAMPLE_UNASSALPHA: /* data is not pre-multiplied */
which causes libtiff to use the following ContigPutFunc starting at
line 1262:
putRGBUAcontig8bittile
{
...
a = pp[3];
r = (a*pp[0] + 127) / 255;
g = (a*pp[1] + 127) / 255;
b = (a*pp[2] + 127) / 255;
}
The alpha is still written out, however, why is the alpha being pre-
multiplied here?
:: Amir Ebrahimi ::
Developer @ Unity Technologies
www.unity3d.com
|
|||||||