2007.07.03 18:37 "[Tiff] BigTIFF extension?", by Phil Harvey

2007.08.06 22:28 "RE: [Tiff] Transparency ... associated or unassociated alpha is morecompatible?", by Chris Cox

If you want transparency, keep it as associated alpha and premultiply according to the spec.

Then file a bug against Apple's TIFF code because someone at Apple failed to read the TIFF spec....

If a channel is marked unassociated, loading it as transparency is also a bug -- because the file says it is NOT transparency.

It sounds like there is nothing wrong with your files, but Apple has some bugs to fix (as do some other software and hardware vendors).


-----Original Message-----
From: tiff-bounces@lists.maptools.org on behalf of William Gallafent
Sent: Mon 8/6/2007 3:08 PM
To: tiff@lists.maptools.org

Subject: [Tiff] Transparency... associated or unassociated alpha is morecompatible?

I'm experimenting with TIFF export for RGBA images, bit depth

eight and sixteen. I need to decide which style of alpha

channel to use in order to maximise interoperability with other

applications, and my experiments so far have been inconclusive. I'm using LibTIFF to do the exporting. I set the following fields:




If I "apply" the alpha channel (multiplying the colour channels before saving), and then save the test image with associated (premultiplied) alpha flag set for the extra channel, it loads correctly in to Photoshop CS3, Acrobat Professional and Apple's iPhoto, for example. Apple's Preview, and Safari, though, do not load it correctly, having very wrong-looking results where the A channel is not 0 or 255 (or 65535 for bit depth 16).

If, on the other hand, I leave the RGB channels at full range, and set the flag for unassociated alpha, I get a result which displays correctly in Apple's Preview, and in Safari. In Photoshop CS3, on the other hand, the transparency is loaded as a separate alpha channel, and it seems that several steps of fiddling must be done in order to apply it and to make it act as the image's transparency channel, as intended.

Apple's iPhoto is the only program I've found which makes a nice-looking result on loading either type without tweaking post-load!

So, which is the preferred format in general? Am I right when I suggest that Adobe's tools seem to prefer associated / premultiplied, and Apple's unassociated? It seems clear from the spec that in this application (the alpha channel is a transparency matte for the foreground object in the image) premultiplied should be the way to go, but if e.g. Apple's tools do not handle such files correctly, and do work with unassociated, then that must be the preferred choice for my application, iff it can be made simple for Photoshop users to achieve their desired result too.

Perhaps there is something wrong with or missing from one or other (or both!) of my output files, which Photoshop is able to cope with in the premultiplied case, and Apple's tools not? For example, I wondered if I should set something such as PHOTOMETRIC_MINISBLACK or PHOTOMETRIC_MINISWHITE to hint further regarding the meaning of the associated alpha channel, but I couldn't see how to make these apply at the same time as the truthful PHOTOMETRIC_RGB of the non-"extra" channels. Or is there a way to make Photoshop load the unassociated file and trivially use the alpha channel as the transparency mask for the image?

I can post a couple of very small (below 5KB compressed) sample files to the list (one associated, the other unassociated, as created by my code), if anybody is interested and nobody objects.

Thanks for any advice,

Bill Gallafent.