TIFF and LibTiff Mail List Archive 2002.03.21 00:24 "16 bit LAB in TIFF - second pass", by Chris Cox 2002.03.21 13:20 "Re: 16 bit LAB in TIFF - second pass", by Martí Maria

# 2002.03.21 00:24 "16 bit LAB in TIFF - second pass", by Chris Cox

L*a*b* Images

Introduction

CIE L*a*b* is a color space that is colorimetric, has separate lightness and chroma channels, and is approximately perceptually uniform. It has excellent applicability for device-independent manipulation of continuous tone images. These attributes make it an excellent choice for many image editing and archiving functions. 1976 CIEL*a*b* is represented as a Euclidean space with the following three quantities plotted along axes at right angles: L* representing lightness, a* representing the red/green axis, and b* representing the yellow/blue axis. The formulas for 1976 CIE L*a*b* follow:

L* = 116(Y/Yn)1/3-16 for Y/Yn > 0.008856
L* = 903.3(Y/Yn) for Y/Yn <= 0.008856 *see note below.
a* = 500[(X/Xn)1/3-(Y/Yn)1/3]
b* = 200[(Y/Yn)1/3-(Z/Zn)1/3].

where Xn,Yn, and Zn are the CIE X, Y, and Z tristimulus values of an appropriate reference white. Also, if any of the ratios X/Xn, Y/Yn, or Z/Zn is equal to or less than 0.008856, the cube root of the ratio is replaced in the formulas with

7.787F + 16/116,

where F is X/Xn, Y/Yn, or Z/Zn, as appropriate (note: these low-light conditions are of no relevance for most document-imaging applications).

Scaling the 0-100 range of L* into 256 levels provides lightness steps that are less than half the size of a "just noticeable difference" in the 8 bit encoding. Limiting the theoretically unbounded a* and b* ranges to +/- 127 allows encoding in 8 bits without eliminating any but the most saturated self-luminous colors

The TIFF CIELAB Fields

Field: PhotometricInterpretation
Status: required
Tag: 262 (106.H)
Type: SHORT
Count: 1
Value: This Field indicates the color space of the image. The new values are:
8 1976 CIE L*a*b*, normal encoding
9 ICCLab encoding

For CIELab (PhotometricInterpretation = 8), the L* component is encoded in 8 bits as an unsigned integer range [0,255], and encoded in 16 bits as an unsigned integer range [0,65535]. The a* and b* components in 8 bits are signed integers range [-128,127], and in 16 bits are signed integers range [-32768,32767]. The 8 bit chrominance values are encoded exactly equal to the 1976 CIE a* and b* values, while the 16 bit values are encoded as 256 times the 1976 CIE a* and b* values.

For ICCLab (PhotometricInterpretation = 9), the L* component is encoded in 8 bits as an unsigned integer range [0,255], and encoded in 16 bits as an unsigned integer range [0,65280]. The a* and b* components in 8 bits are unsigned integers range [0,255], and in 16 bits are unsigned integers range [0,65535]. The 8 bit chrominance values are encoded exactly equal to the 1976 CIE a* and b* values plus 128, while the 16 bit values are encoded equal to 256 times the 1976 CIE a* and b* values plus 32768 (this is also 256 times the 8 bit encoding). PhotometricInterpretation 9 is designed to match the encoding used by the ICC profile specification version 2 (taken from ICC document ICC.1:1998-09 "File Format for Color Profiles").

Usage of other Fields

BitsPerSample: 8 or 16
SamplesPerPixel - ExtraSamples: 3 for L*a*b*, 1 implies L* only, for monochrome data.
Compression: same as other multi-bit formats.
PlanarConfiguration: both chunky and planar data could be supported.
WhitePoint: default is CIE D50, may be omitted if default value applies
PrimaryChromaticities: does not apply.
TransferFunction: does not apply