2001.10.05 22:22 "16-bit ICC L*a*b* ?", by Dwight Kelly

2001.10.06 14:32 "Re: 16-bit ICC L*a*b* ?", by Martí Maria

Has anyone worked with 8 or 16-bit ICC L*a*b* TIFF files? Photometric == 9 as defined in Pagemaker TIFF extensions?


I have been working with such beasts. 16 bps is forbidden by spec 6, but is widely used. (8 bit is not enough for a precission-demanding app). The most remarcable thing about 16 bit Lab, is L being encoded in the ICC way, that is, L=100 is represented as 0xFF00 instead of 0xFFFF. Also, spec 6 does require D65 as white point, but many apps (Photoshop, for example) are using D50 instead.

Lab TIFF of 8 bits are encoded using:

L: 0...FF -> 0..100
a,b: 0..FF -> -128...127

To decode to float, you need to divide L by 2.55. For the a, b parts, substract 128 if greater that 127. The 16 bit form uses fixed point 7.8 for a, b. This is a rare case, where simple shifting << 8 and >> 8 can be used to convert between 8/16 representations.

0xFF00 >> 8 = 0xFF
Fixed 7.8 >> 8 = integer part

One fast and accurate way to do the decode/encode process, is to use a ICC profile. You can find the TiffLab8spac.icm profile (among unrelated others) on http://www.littlecms.com/profiles.zip. The profile does handle 8 and 16 bits, and implements both read and write directions.

Hope this helps,