RGB to CIE (XYZ)

RGB values for modern video monitors have CIE xyz coordinates given by the following matrix equation

where

Each column in the matrix C corresponds to the xyz values of one of the RGB primaries, and therefore must add to one (x+y+z=1).

The relative values of RGB must be adjusted to produce the proper value of white, in this case the Illuminant D65 with chromaticity coordinates.

First we convert chromaticity (x, y) to xyz.

The luminance of a color in CIE XYZ coordinates is the Y value, which is normalized to 1 for the maximum white signal level. For R=B=G=1, the desired XYZ values must be given by.

RGB can be obtained directly from XYZ by inverting the C matrix.

This gives the relative scaling k of RGB needed to produce white when R=G=B=1.

The complete transformation from RGB to XYZ is then given by

The numerical values for the matrix are

This is the same matrix as that given by Poynton in the Color FAQ.


Maintained by John Loomis, last updated May 19, 1997