2007.01.31 16:39 "[Tiff] 16bit grayscale with colormap", by Reinhard Mayr aka Czerwinski

2007.01.31 17:31 "Re: [Tiff] 16bit grayscale with colormap", by Joris Van Damme

Reinhard,

I deal with 16bit grayscale TIFFs. The files originate from a 12bit CCD, so the linear conversion 16bit->8bit turns my image almost black.

You can write 12bit grayscale. It is perfectly legit TIFF. However, few readers will support it. You can also rescale to a more common bitdepth, like 8bit or 16bit, before writing.

To cope with that, I would like to add a ColorMap into the TIFF. For testing, I altered an existing 16bit file:

You mean 3*2^16 words, not bytes. Palettes (Colormaps) in TIFF are 3 word values per palette entry.

Is this a proper interpretation of the TIFF specs (TIFF6 specs p.23 allow only 4/8 bits per sample -- why?)?

Yes it is a proper interpretation of the TIFF spec. The pages you refer to, are *baseline* TIFF. The whole concept of baseline TIFF is a bit dated, as many flavours that aren't originally regarded baseline are commonly supported these days. But in any case, even originally, there wasn't a restriction to 4 or 8 bits per sample in Colormap TIFFs as long as you know they're not baseline.

In general, TIFF is extremely flexible this way. You can have a 21 bit Colormap TIFF, or a 36 bit grayscale TIFF, or an 11-13-15 bits per sample RGB TIFF. It's all unambigious, and all legit. It is, however, badly supported by most readers.

Best regards,

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html