The PNG Guide is an eBook based on Greg Roelofs' book, originally published by O'Reilly. |
Home Gamma Correction and Precision Color Chromaticity | |||||||||||||||||||||
See also: Gamma and Color Correction, Color Insert: Chromaticity Diagram | |||||||||||||||||||||
Chromaticity
Figure C-2 in the color insert, shows an interestingly
shaped color blob with a numbered curve and a brighter triangle embedded in
it and some numbers around its curved edge. The blob represents the complete
range of hues and saturation levels that the human eye can discern; a true
spectrum would wrap around the numbered edge[80]
(albeit without the cyan region near the upper left). The middle is composed
of smoothly interpolated mixtures, including ``white.'' The numbers on the
axes give the x and y
values of each hue and are directly related
Because the diagram has been projected down from a three-dimensional color space (XYZ) to the two-dimensional xy plane, information about the relative intensities of red, green, and blue has been lost. That is, the x,y values for the red phosphor indicate what color it emits at any given intensity level and similarly for the green and blue phosphors. But we still need to know the relative intensities of the three phosphors when they are all at full power. This is where the concept of ``white'' comes in. In fact, there are many candidates for ``white,'' from the warm, yellowish whites produced by incandescent lightbulbs to the cool, bluish whites of electrical arcs and lightning.[81] The curved line in the middle represents all possible values of ``white'' for a given monitor, only one of which will be displayed as such. The associated numbers along the curve refer to the ``blackbody temperature'' or color temperature of any given white value; among other things, a star whose surface (photosphere) is at the given temperature will emit light of the given color most strongly. [82] Our Sun's surface temperature is around 6,000 degrees Kelvin, for example; not coincidentally, this is the color temperature most humans associate with ``average'' or ``true'' white.
The simple way to deal with such conversions is to feed the information to a color management system (CMS), assuming one is present. All of the tricky details of conversion between different color spaces and of mapping different monitor gamuts are handled by the CMS. Color management systems are not yet in wide use on typical users' platforms, however; a decoding application that wishes to maintain optimal color fidelity will need to handle the conversions on its own. The calculations to do so are not terribly difficult, but they do involve a number of matrix operations. These are detailed in of the University of Manchester's excellent tutorial, Colour in Computer Graphics, and also in the "Color Tutorial" section of the PNG Specification, Version 1.1. The structure of cHRM is shown in Table 10-2.
Each of the eight values is an unsigned long integer, equal to the actual
floating-point value multiplied by 100,000 and rounded to the nearest integer.
Like the gAMA chunk, cHRM must precede all IDAT chunks and, if present, PLTE;
only one cHRM chunk is allowed.
|
|||||||||||||||||||||
Home Gamma Correction and Precision Color Chromaticity |