AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
April 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.04.27 19:49 "Question regarding unassociated alpha", by Amir Ebrahimi
2009.04.27 20:00 "Re: Question regarding unassociated alpha", by Chris Cox
2009.04.27 20:03 "Re: Question regarding unassociated alpha", by Amir Ebrahimi
2009.04.27 20:07 "Re: Question regarding unassociated alpha", by Chris Cox
2009.04.27 20:26 "Re: Question regarding unassociated alpha", by Edward Lam
2009.04.27 20:28 "Re: Question regarding unassociated alpha", by Edward Lam
2009.04.27 20:32 "Re: Question regarding unassociated alpha", by Amir Ebrahimi
2009.04.27 20:45 "Re: Question regarding unassociated alpha", by Edward Lam
2009.04.27 20:49 "Re: Question regarding unassociated alpha", by Edward Lam
2009.04.27 20:54 "Re: Question regarding unassociated alpha", by Amir Ebrahimi
2009.04.27 21:22 "Re: Question regarding unassociated alpha", by Bob Friesenhahn
2009.04.27 21:14 "Re: Question regarding unassociated alpha", by Daniel Mccoy
2009.04.27 21:33 "Re: Question regarding unassociated alpha", by Amir Ebrahimi
2009.04.28 20:37 "Re: Question regarding unassociated alpha", by Chris Cox
2009.04.28 22:12 "Re: Question regarding unassociated alpha", by Daniel Mccoy
2009.04.29 03:37 "Re: Question regarding unassociated alpha", by Bob Friesenhahn

2009.04.27 19:49 "Question regarding unassociated alpha", by Amir Ebrahimi

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