Reproducing Visible Spectra

by Nick Spiker

Edited by Sam Goldwasser

If you have ever tried to reproduce a true rainbow, or spectra in the visible range you may have noticed that you will end up with much less than ideal results. The main reason for this is that when you reproduce color on a typical display, CRT, LCD, Plasma, DLP, etc., you generally only have a set number of colors to mix and produce an image. Generally there are three colored primaries. Some higher end DLP systems will use more than three colors. Most of the people reading this are probably somewhat familiar with basic principles of operation behind most of these systems. So I won't be covering the basics behind the mixing of color, and image output. I do, however frequently see a large number of people that do not understand gamma as it applies to images and image output systems. So I will cover it briefly in this section. Gamma is a way of encoding image information in a nonlinear fashion. Generally when this is done, more information is assigned to the darker values, and less in the highlights. This is the case for any image with a gamma greater than one. Usually a gamma of about two is used for image storage and representation. The primary reason for assigning more information in the darker areas is because the human eye is less sensitive to changes in bright areas.

sRGB-gamma shows a plot of the sRGB intensities versus sRGB numerical values (red), and this function's slope in log-log space (blue) which is the effective gamma at each point. sRGB clips values below a certain numerical limit to reduce numerical problems because the slope approaches infinity.

Now, on to reproducing an accurate color spectra on a standard display. In 1931, the CIE (International Commission on Illumination) decided to develop a standard for human vision. They took three monochromatic light sources and had a bunch of people adjust the brightness of the three primaries to match them with a particular color from the visible spectrum. The three primaries were chosen so that it roughly approximated the three types of color receptors (cone cells) in the human eye and were easily reproducible from a mercury vapor light source. The wavelengths of 700 nm (red), 546.1 nm (green) and 435.8 nm (blue) were chosen for the primaries. To match the colors, negative values of light had to be used. The reason for the negative values is because you cannot directly stimulate one color receptor without stimulating another. In order to achieve the negative values, white light was added to the sample of the spectrum to be matched until it could be matched with the three primaries. The amount of white light needed represents the amount to be subtracted from the three primaries.

2 Degree-CIE-Linear is a plot of the spectra into the CIE RGB color space as seen by an average human eye in a 2 Degree FOV and with no gamma correction applied. Once this data was obtained, it was translated into a new space which had the following properties:

  1. The new color matching functions were to be everywhere greater than or equal to zero. In 1931, computations were done by hand or slide rule, and the specification of positive values was a useful computational simplification.

  2. The color matching function would be exactly equal to the photopic luminous efficiency function (yellow) in Photopic-&-Scotopic-Response for the "CIE standard photopic observer".

See Photopic-&-Scotopic-Response.

The luminance function describes the variation of perceived brightness with wavelength. The fact that the luminance function could be constructed by a linear combination of the RGB color matching functions was not guaranteed by any means but might be expected to be nearly true due to the near-linear nature of human sight. Again, the main reason for this requirement was computational simplification.

For the constant energy white point, it was required that x = y = z = 1/3. By virtue of the definition of chromaticity and the requirement of positive values of x and y, it can be seen that the gamut of all colors will lie inside the triangle [1,0], [0,0], [0,1]. It was required that the gamut fill this space practically completely. It was found that the color matching function could be set to zero above 650 nm while remaining within the bounds of experimental error. For computational simplicity, it was specified that this would be so.

2 Degree CIE-1931-XYZ-Linear is a is a plot of the spectra into the CIE 1931 XYZ color space as seen by an average human eye in a 2 Degree FOV and with no gamma correction applied.

Most other RGB color spaces are defined in terms of the CIE Chart.

Now, on with the problem of producing all of the colors on a standard RGB display. As you can see on the CIE chart, the sRGB space lies completely within the monochromatic lobe. So, in order to reproduce the color spectra on a sRGB model, a constant value has to be added to the colors to compensate for the negative effects of conversion into sRGB space. Basically this is a desaturation method roughly equivalent to shining the spectra onto an already lit surface. This is shown in sRGB-Combo.

2 Degree-sRGB-Linear is a plot of the spectra into the CIE RGB color space as seen by an average human eye in a 2 Degree FOV and with no gamma correction applied.

After the positive value is added, conversion into the sRGB space including gamma correction looks like 2 Degree-sRGB, which is a plot of the spectra into the sRGB IEC61966-2.1 color space as seen by an average human eye in a 2 Degree FOV with gamma correction applied. There has been a linear addition to all wavelengths to compensate for the primary color locations of the sRGB color space. The grey horizontal line represents where black would be if sRGB could reproduce the full spectra.

And the rendered spectra looks like 2 Degree-sRGB-Spectra, which is a rendering of the spectra into the sRGB IEC61966-2.1 color space as seen by an average human eye in a 2 Degree FOV with gamma correction applied. There has been a linear addition to all wavelengths to compensate for the primary color locations of the sRGB color space.

The reason I am using the 2 Degree FOV data, is that it is the standard for the CIE space, and it generally produces more accurate results than the 10 Degree FOV data from 10 Degree-CIE-Linear, which is a plot of the spectra into the CIE RGB color space as seen by an average human eye in a 10 Degree FOV and with no gamma correction applied.

I have included some other rendering methods that do not produce accurate results, but can be used for general reference:

If you would like to know more about the specifics of human color vision, some good articles, along with examples and other links can be found at Wikipedia Color Vision and Wikipedia sRGB.