Previous Next


TIFF 6.0 Specification                                                                  Final—June 3, 1992




                         SMaxSampleValue
                         Tag    = 341 (155.H)
                         Type = the field type that best matches the sample data
                         N      = SamplesPerPixel
                         This new field specifies the maximum sample value.


Comments
                         The SampleFormat field allows more general imaging (such as image processing)
                         applications to employ TIFF as a valid file format.
                         SMinSampleValue and SMaxSampleValue become more meaningful when im-
                         age data is typed. The presence of these fields makes it possible for readers to
                         assume that data samples are bound to the range [SMinSampleValue,
                         SMaxSampleValue] without scanning the image data.


References
                         [IEEE] “IEEE Standard 754 for Binary Floating-point Arithmetic”.




                                              81

TIFF 6.0 Specification Final—June 3, 1992 Section 20: RGB Image Colorimetry Without additional information, RGB data is device-specific; that is, without an absolute color meaning. This section describes a scheme for describing and char- acterizing RGB image data. Introduction Color printers, displays, and scanners continue to improve in quality and avail- ability while they drop in price. Now the problem is to display color images so that they appear to be identical on different hardware. The key to reproducing the same color on different devices is to use the CIE 1931 XYZ color-matching functions, the international standard for color comparison. Using CIE XYZ, an image’s colorimetry information can fully describe its color interpretation. The approach taken here is essentially calibrated RGB. It implies a transformation from the RGB color space of the pixels to CIE 1931 XYZ. The appearance of a color depends not only on its absolute tristimulus values, but also on the conditions under which it is viewed, including the nature of the sur- round and the adaptation state of the viewer. Colors having the same absolute tristimulus values appear the same in identical viewing conditions. The more complex issue of color appearance under different viewing conditions is ad- dressed by [4]. The colorimetry information presented here plays an important role in color appearance under different viewing conditions. Assuming identical viewing conditions, an application using the tags described below can display an image on different hardware and achieve colorimetrically identical results. The process of using this colorimetry information for displaying an image is straightforward on a color monitor but it is more complex for color printers. Also, the results will be limited by the color gamut and other characteris- tics of the display or printing device. The following fields describe the image colorimetry information of a TIFF image: WhitePoint chromaticity of the white point of the image PrimaryChromaticities chromaticities of the primaries of the image TransferFunction transfer function for the pixel data TransferRange extends the range of the transfer function ReferenceBlackWhite pixel component headroom and footroom parameters The TransferFunction, TransferRange, and ReferenceBlackWhite fields have defaults based on industry standards. An image has a colorimetric interpretation if and only if both the WhitePoint and PrimaryChromaticities fields are present. An image without these colorimetry fields will be displayed in an application and hardware dependent manner. Note: In the following definitions, BitsPerSample is used as if it were a single number when in fact it is an array of SamplesPerPixel numbers. The elements of 82

TIFF 6.0 Specification Final—June 3, 1992 this array may not always be equal, for example: 5/6/5 16-bit pixels. BitsPerSample should be interpreted as the BitsPerSample value associated with a particular component. In the case of unequal BitsPerSample values, the defini- tions below can be extended in a straightforward manner. This section has the following differences with Appendix H in TIFF 5.0: • removed the use of image colorimetry defaults • renamed the ColorResponseCurves field as TransferFunction • optionally allowed a single TransferFunction table to describe all three chan- nels • described the use of the TransferFunction field for YCbCr, Palette, WhiteIsZero and BlackIsZero PhotometricInterpretation types • added the TransferRange tag to expand the range of the TransferFunction below black and above white • added the ReferenceBlackWhite field • addressed the issue of color appearance Colorimetry Field Definitions WhitePoint Tag = 318 (13E.H) Type = RATIONAL N =2 The chromaticity of the white point of the image. This is the chromaticity when each of the primaries has its ReferenceWhite value. The value is described using the 1931 CIE xy chromaticity diagram and only the chromaticity is specified. This value can correspond to the chromaticity of the alignment white of a monitor, the filter set and light source combination of a scanner or the imaging model of a rendering package. The ordering is white[x], white[y]. For example, the CIE Standard Illuminant D65 used by CCIR Recommendation 709 and Kodak PhotoYCC is: 3127/10000,3290/10000 No default. PrimaryChromaticities Tag =319 (13F.H) Type = RATIONAL N =6 83

TIFF 6.0 Specification Final—June 3, 1992 The chromaticities of the primaries of the image. This is the chromaticity for each of the primaries when it has its ReferenceWhite value and the other primaries have their ReferenceBlack values. These values are described using the 1931 CIE xy chromaticity diagram and only the chromaticities are specified. These values can correspond to the chromaticities of the phosphors of a monitor, the filter set and light source combination of a scanner or the imaging model of a rendering package. The ordering is red[x], red[y], green[x], green[y], blue[x], and blue[y]. For example the CCIR Recommendation 709 primaries are: 640/1000,330/1000, 300/1000, 600/1000, 150/1000, 60/1000 No default. TransferFunction Tag =301 (12D.H) Type = SHORT N = {1 or 3} * (1 << BitsPerSample) Describes a transfer function for the image in tabular style. Pixel components can be gamma-compensated, companded, non-uniformly quantized, or coded in some other way. The TransferFunction maps the pixel components from a non-linear BitsPerSample (e.g. 8-bit) form into a 16-bit linear form without a perceptible loss of accuracy. If N = 1 << BitsPerSample, the transfer function is the same for each channel and all channels share a single table. Of course, this assumes that each channel has the same BitsPerSample value. If N = 3 * (1 << BitsPerSample), there are three tables, and the ordering is the same as it is for pixel components of the PhotometricInterpretation field. These tables are separate and not interleaved. For example, with RGB images all red entries come first, followed by all green entries, followed by all blue entries. The length of each component table is 1 << BitsPerSample. The width of each entry is 16 bits as implied by the type SHORT. Normally the value 0 represents the minimum intensity and 65535 represents the maximum intensity and the val- ues [0, 0, 0] represent black and [65535,65535, 65535] represent white. If the TransferRange tag is present then it is used to determine the minimum and maxi- mum values, and a scaling normalization. The TransferFunction can be applied to images with a PhotometricInterpretation value of RGB, Palette, YCbCr, WhiteIsZero, and BlackIsZero. The TransferFunction is not used with other PhotometricInterpretation types. For RGB PhotometricInterpretation, ReferenceBlackWhite expands the coding range, TransferRange expands the range of the TransferFunction, and the TransferFunction tables decompand the RGB value. The WhitePoint and PrimaryChromaticities further describe the RGB colorimetry. 84

TIFF 6.0 Specification Final—June 3, 1992 For Palette color PhotometricInterpretation, the Colormap maps the pixel into three 16-bit values that when scaled to BitsPerSample-bits serve as indices into the TransferFunction tables which decompand the RGB value. The WhitePoint and PrimaryChromaticities further describe the underlying RGB colorimetry. A Palette value can be scaled into a TransferFunction index by: index= (value * ((1 << BitsPerSample) - 1)) / 65535; A TransferFunction index can be scaled into a Palette color value by: value= (index * 65535L) / ((1 << BitsPerSample) - 1); Be careful if you intend to create Palette images with a TransferFunction. If the Colormap tag is directly converted from a hardware colormap, it may have a device gamma already incorporated into the DAC values. For YCbCr PhotometricInterpretation, ReferenceBlackWhite expands the coding range, the YCbCrCoefficients describe the decoding matrix to transform YCbCr into RGB, TransferRange expands the range of the TransferFunction, and the TransferFunction tables decompand the RGB value. The WhitePoint and PrimaryChromaticities fields provide further description of the underlying RGB colorimetry. After coding range expansion by ReferenceBlackWhite and TransferFunction expansion by TransferRange, RGB values may be outside the domain of the TransferFunction. Also, the display device matrix can transform RGB values into display device RGB values outside the domain of the device. These values are handled in an application-dependent manner. For RGB images with non-default ReferenceBlackWhite coding range expansion and for YCbCr images, the resolution of the TransferFunction may be insuffi- cient. For example, after the YCbCr transformation matrix, the decoded RGB values must be rounded to index into the TransferFunction tables. Applications needing the extra accuracy should interpolate between the elements of the TransferFunction tables. Linear interpolation is recommended. For WhiteIsZero and BlackIsZero PhotometricInterpretation, the TransferFunction decompands the grayscale pixel value to a linear 16-bit form. Note that a TransferFunction value of 0 represents black and 65535 represents white regardless of whether a grayscale image is WhiteIsZero or BlackIsZero. For example, the zeroth element of a WhiteIsZero TransferFunction table will likely be 65535. This extension of the TransferFunction field for grayscale im- ages is intended to replace the GrayResponseCurve field. The TransferFunction does not describe a transfer characteristic outside of the range for ReferenceBlackWhite. Default is a single table corresponding to the NTSC standard gamma value of 2.2. This table is used for each channel. It can be generated by: NValues = 1 << BitsPerSample; for (TF[0]= 0, i = 1; i < NValues; i++) TF[i]= floor(pow(i / (NValues - 1.0), 2.2) * 65535 + 0.5); 85

TIFF 6.0 Specification Final—June 3, 1992 TransferRange Tag = 342 (156.H) Type = SHORT N =6 Expands the range of the TransferFunction. The first value within a pair is associ- ated with TransferBlack and the second is associated with TransferWhite. The ordering of pairs is the same as for pixel components of the PhotometricInterpretation type. By default, theTransferFunction is defined over a range from a minimum intensity, 0 or nominal black, to a maximum intensity,(1 << BitsPerSample) - 1 or nominal white. Kodak PhotoYCC uses an extended range TransferFunction in order to describe highlights, saturated colors and shadow detail beyond this range. The TransferRange expands the TransferFunction to support these values. It is defined only for RGB and YCbCr PhotometricInterpretations. After ReferenceBlackWhite and/or YCbCr decoding has taken place, an RGB value can be represented as a real number. It is then rounded to create an index into the TransferFunctiontable. In the absence of a TransferRange tag, or if the tag has the default values, the rounded value is an index and the normalized inten- sity value is: index = (int) (value + (value < 0.0? -0.5 : 0.5)); intensity = TF[index] / 65535; If the TransferRange tag is present and has non-default values, it provides an offset to be used with the rounded index. It also describes a scaling. The normal- ized intensity value is: index = (int) (value + (value < 0.0? -0.5 : 0.5)); intensity = (TF[index + TransferRange[Black]] - TF[TransferRange[Black]]) / (TF[TransferRange[White]] - TF[TransferRange[Black]]); An application can write a TransferFunction with a non-defaultTransferRange as follows: black_offset = scale_factor * Transfer(-TransferRange[Black]ar / (TransferRange[White] - TransferRange[Black])); for (i = 0; i < (1 << BitsPerSample); i++) TF[i] = floor(0.5 - black_offset + scale_factor * Transfer((i - TransferRange[Black]) / (TransferRange[White] - TransferRange[Black]))); The TIFF writer chooses scale_factor such that the TransferFunction fits into a 16-bit unsigned short, and chooses the TransferRange so that the most important part of the TransferFunction fits into the table. Default is [0, NV, 0, NV, 0, NV] where NV = (1 <<BitsPerSample) - 1. ReferenceBlackWhite Tag =532 (214.H) Type = RATIONAL N =6 86

TIFF 6.0 Specification Final—June 3, 1992 Specifies a pair of headroom and footroom image data values (codes) for each pixel component. The first component code within a pair is associated with ReferenceBlack, and the second is associated with ReferenceWhite. The ordering of pairs is the same as those for pixel components of the PhotometricInterpretation type. ReferenceBlackWhite can be applied to images with a PhotometricInterpretation value of RGB or YCbCr. ReferenceBlackWhite is not used with other PhotometricInterpretation values. Computer graphics commonly places black and white at the extremities of the binary representation of image data; for example, black at code 0 and white at code 255. In other disciplines, such as printing, film, and video, there are practical reasons to provide footroom codes below ReferenceBlack and headroom codes above ReferenceWhite. In film applications, they correspond to the densities Dmax and Dmin. In video applications, ReferenceBlack corresponds to 7.5 IRE and 0 IRE in systems with and without setup respectively, and ReferenceWhite corresponds to 100 IRE units. Using YCbCr (See Section 21) and the CCIR Recommendation 601.1 video stan- dard as an example, code 16 represents ReferenceBlack, and code 235 represents ReferenceWhite for the luminance component (Y). For the chrominance compo- nents, Cb and Cr, code 128 represents ReferenceBlack, and code 240 represents ReferenceWhite. With Cb and Cr, the ReferenceWhite value is used to code reference blue and reference red respectively. The full range component value is converted from the code by: FullRangeValue = (code - ReferenceBlack) * CodingRange / (ReferenceWhite - ReferenceBlack); The code is converted from the full-range component value by: code = (FullRangeValue * (ReferenceWhite - ReferenceBlack) / CodingRange) + ReferenceBlack; For RGB images and the Y component of YCbCr images, CodingRange is de- fined as: CodingRange = 2 ** BitsPerSample - 1; For the Cb and Cr components of YCbCr images, CodingRange is defined as: CodingRange = 127; For RGB images, in the default special case of no headroom or footroom, this conversion can be skipped because the scaling multiplier equals 1.0 and the value equals the code. For YCbCr images, in the case of no headroom or footroom, the conversion for Y can be skipped because the value equals the code. For Cb and Cr, ReferenceBlack must still be subtracted from the code. In the general case, the scaling multiplica- tion for the Cb and Cr component codes can be factored into the YCbCr transform matrix. Useful ReferenceBlackWhite values for YCbCr images are: [0/1, 255/1,128/1, 255/1, 128/1, 255/1] no headroom/footroom [15/1, 235/1, 128/1, 240/1, 128/1, 240/1] CCIR Recommendation 601.1 headroom/footroom 87

TIFF 6.0 Specification Final—June 3, 1992 Useful ReferenceBlackWhite values for BitsPerSample = 8,8,8 Class R images are: [0/1, 255/1,0/1, 255/1, 0/1, 255/1] no headroom/footroom [16/1, 235/1, 16/1, 235/1, 16/1, 235/1] CCIR Recommendation 601.1 headroom/footroom Default is [0/,NV/1, 0/1, NV/1, 0/1, NV/1] where NV = 2 ** BitsPerSample - 1. References [1] The Reproduction of Colour in Photography, Printing and Television, R. W. G. Hunt, Fountain Press, Tolworth, England,1987. [2] Principles of Color Technology, Billmeyer and Saltzman, Wiley- Interscience, New York, 1981. [3] Colorimetric Properties of Video Displays, William Cowan, University of Waterloo, Waterloo, Canada, 1989. [4] TIFF Color Appearance Guidelines, Dave Farber, Eastman Kodak Com- pany, Rochester, New York. 88

TIFF 6.0 Specification Final—June 3, 1992 Section 21: YCbCr Images Introduction Digitizers of video sources that create RGB data are becoming more capable and less expensive. The RGB color space is adequate for this purpose. However, for both digital video and image compression applications a color difference color space is needed. The television industry depends on YCbCr for digital video. For image compression, subsampling the chrominance components allows for greater compression. TIFF YCbCr (which we shall call Class Y) supports these images and applications. Class Y is based on CCIR Recommendation 601-1, “Encoding Parameters of Digital Television for Studios.” Class Y also has parameters that allow the de- scription of related standards such as CCIR Recommendation 709 and technologi- cal variations such as component-sample positioning. YCbCr is a distinct PhotometricInterpretation type. RGB pixels are converted to and from YCbCr for storage and display. Class Y defines the following fields: YCbCrCoefficients transformation from RGB to YCbCr YCbCrSubSampling subsampling of the chrominance components YCbCrPositioning positioning of chrominance component samples relative to the luminance samples In addition, ReferenceBlackWhite, which specifies coding range expansion, is required by Class Y. See Section 20. Class Y YCbCr images have three components: Y, the luminance component, and Cb and Cr, two chrominance components. Class Y uses the international standard notation YCbCr for color-difference component coding. This is often incorrectly called YUV, which properly applies only to composite coding. The transformations between YCbCr and RGB are linear transformations of uninterpreted RGB sample data, typically gamma-corrected values. The YCbCrCoefficients field describes the parameters of this transformation. Another feature of Class Y comes from subsampling the chrominance compo- nents. A Class Y image can be compressed by reducing the spatial resolution of chrominance components. This takes advantage of the relative insensitivity of the human visual system to chrominance detail. The YCbCrSubSampling field de- scribes the degree of subsampling which has taken place. When a Class Y image is subsampled, each Cb and Cr sample is associated with a group of luminance samples. The YCbCrPositioning field describes the position of the chrominance component samples relative to the group of luminance samples: centered or cosited. Class Y requires use of the ReferenceBlackWhite field. This field expands the coding range by describing the reference black and white values for the different components that allow headroom and footroom for digital video images. Since the 89

TIFF 6.0 Specification Final—June 3, 1992 default for ReferenceBlackWhite is inappropriate for Class Y, it must be used explicitly. At first, it might seem that the information conveyed by Class Y and the RGB Colorimetry section is redundant. However, decoding YCbC r to RGB primaries requires the YCbCr fields, and interpretation of the resulting RGB primaries re- quires the colorimetry and transfer function information. See the RGB Colorim- etry section for details. Extensions to Existing Fields Class Y images use a distinct PhotometricInterpretation Field value: PhotometricInterpretation Tag = 262 (106.H) Type = SHORT N =1 This Field indicates the color space of the image. The new value is: 6 = YCbCr A value of 6 indicates that the image data is in the YCbCr color space. TIFF uses the international standard notation YCbCr for color-difference sample coding. Y is the luminance component. Cb and Cr are the two chrominance components. RGB pixels are converted to and from YCbCr form for storage and display. Fields Defined in Class Y YCbCrCoefficients Tag = 529 (211.H) Type = RATIONAL N =3 The transformation from RGB to YCbC r image data. The transformation is speci- fied as three rational values that represent the coefficients used to compute lumi- nance, Y. The three rational coefficient values, LumaRed, LumaGreen and LumaBlue, are the proportions of red, green, and blue respectively in luminance, Y. Y, Cb, and Cr may be computed from RGB using the luminance coefficients specified by this field as follows: Y = ( LumaRed * R + LumaGreen * G + LumaBlue * B ) Cb = ( B - Y ) / ( 2 - 2 * LumaBlue ) 90

Previous Next