Device Independent Color

Basics of Device-Independent Color
sRGB Color Space and the Internet

Reference: "A Standard Default Color Space for the Internet -- sRGB" by Michael Stokes, Matthew Anderson, Srinivasan Chandrasekar, and Ricardo Motta, 1996.

1. Basics of Device-Independent Color


There is a problem characterizing colors using simply the RGB values of each pixel: unfortunately many devices have a different idea of just what color a particular RGB triple corresponds to.

What is an RGB vector? --- a set of three integers between 0 and 255. We would be comfortable with a situation in which an RGB vector gave a ``white" light. And it does, on most terminals, approximately.

What is a color? The values of cone stimulation in the retina brought about by some signal with spectral power distribution impinging on the eye, with spectral sensitivity curve (in the red channel, and similarly in the G and B), integrated over the visible spectrum as in 3.3.1.

How is a color characterized? The values (X,Y,Z) are (linearly) related to those retinal values (which are presumably in turn related to neural firing rates).

However, RGB is not a linear matrix transform away from XYZ (and XYZ characterizes the color in the sense that it is a human--derived quantity). Only when the device's spectral sensitivity curves are a linear transform away from the ``color--matching" curves is it correct to write down a matrix relating RGB to XYZ.

But that doesn't stop us from trying! In particular, we can envisage what would be a ``usual" environment for shooting an image --- what would be the light level (outdoors, say, blue sky lighting), and what would be the environment in which the image is viewed on an output device (indoors, say, with low lighting, perhaps incandescent or window lighting).

For CRT output, the NTSC standard specifies a particular matrix relating XYZ to RGB. This rule tries to capture in a simply way how output RGB is related to the correct XYZ. Color TVs follow the NTSC rule, except that there is another subsequent nonlinear transform that takes into effect how much light intensity actually is generated by an input pixel value (or electron gun voltage)--- this is the ``gamma" transform and it raises the input pixel value by exponentiation with a constant power, usually 2.2. The 2.2 exponent is called the gamma value.

So the NTSC standard says: make an RGB value from a desired XYZ by multiplying by a matrix and then raising to the power gamma. (Of course, proprietary manufacturers' tricks are used to further enhance contrast and crispness via a set of kludges --- have you ever noticed that the `black' of a TV screen or color monitor is blacker than the color of screen when the machine is turned off?)

2. sRGB Color Space and the Internet


However, nowadays we wish to communicate accurate ``device--independent" color amongst many different devices: good color cameras, camcorders, color scanners, color printers, etc., and in particular we want to exchange color information on the internet. One method to achieve good color accuracy is to loop together all this apparatus: image your monitor with your camera, print that, scan the printed version, and then display! By iterating, automatic systems exist to get all the colors along the circuit right, essentially by developing a large set of lookup tables for each device.

Another approach is transmitting each image together with the spectral sensitivity curves of the device that imaged the file. But that takes more storage and is impractical for dealing with image file formats already in use.

Therefore, Microsoft and Hewlett-Packard have developed a new standardized XYZ to RGB transform which performs well, for output on color monitors at least. This is a transform very much like the NTSC standard, but is said to do better and is also specifically aimed at computer monitor output devices.

The method starts with a desired XYZ vector. Then a new vector with subscript sRGB is given by

At this point, sRGB values less than zero or greater than 1 are clipped to 0 and 1.

Now a nonlinear transformation is carried out to form sRGB ' values:

(a different equation holds for very small values).

This is essentially the inverse of a gamma=2.2 correction, but puts in an offset to allow for integer math.

Finally, 8--bit RGB digital pixel values are calculated by multiplying the above by 255.

The idea then would be that images are encoded via the above and transmitted as values. Then every image would be assumed to be in sRGB unless explicitly otherwise stated by means of a new set of standardized HTML tags already agreed to by an international color organization. The job of anyone wishing to communicate accurate(ish) color on the internet will then be to correctly map their own device RGB values into XYZ, and then into sRGB for transmission.

The result of the chain of transformations to sRGB is as in the figure below; here the X,Y values for single spectral lines make up a ``horseshoe" shape --- the ``spectrum locus". (The Z value is in fact given by 1-X-Y because of the way these special values were calculated). The gamut of all colors produced by any output device will certainly lie within this boundary. The circle is a white point for one of the many standard ``white"s.

The sRGB gamut is shown on the right; here just the red and green values are shown but in actuality the gamut is 3--dimensional in a red,green,blue space.

It is argued that this is a better map to human percepts, and will likely be used for scanners, cameras, etc.

  
Top | Chap 3 | CMPT 365 Home Page | CS