This is the colour space produced on a CRT (or similar) display when pixel values are applied to a graphics card. To convert RGB pixel values to CIE XYZ tri-stimulus values is a two stage process.
1) Calculate the displayed luminance for each pixel value, this is done by applying the gamma correction factor to the signal. Ideally this should be calculated for each channel independently, (see sections 2 and 6).
2) Perform a matrix transform from the linear RGB to CIE XYZ values. This transform takes the following form.
|X| |Xr Xg Xb| |R|
|Y| = |Yr Yg Yb| * |G|
|Z| |Zr Zg Zb| |B|
where Xr,Yr,Zr, are the CIE XYZ tristimulus values of the red phosophor
at full emission measured from the CRT faceplate.
Xg,Yg,Zg, are the CIE XYZ tristimulus values of the green phosophor
at full emission measured from the CRT faceplate.
and Xb,Yb,Zb, are the CIE XYZ tristimulus values of the blue phosophor
at full emission measured from the CRT faceplate.
R, G and B are the corrected pixel values obtained from the previous step
(by gamma correction).
X, Y and Z are the resultant CIE XYZ tristimulus values of the displayed
colour.To convert from XYZ to RGB use the inverse matrix.
|R| |Xr Xg Xb|(-1) |X|
|G| = |Yr Yg Yb| * |Y|
|B| |Zr Zg Zb| |Z|
In section this relationship is given for a typical television system,
for this system the matrix to convert RGB to XYZ is as follows...
|X| |0.431 0.342 0.178| |R|
|Y| = |0.222 0.707 0.071| * |G|
|Z| |0.020 0.130 0.939| |B|
which gives;
X = 0.431*R + 0.342*G + 0.178*B
Y = 0.222*R + 0.707*G + 0.071*B
Z = 0.020*R + 0.130*G + 0.939*B
Which, given specific RGB values, can be used to calculate CIE XYZ.
Source code is given in Travis' book for matrix transforms between RGB and
CIE XYZ. (see references).Often, it is not possible to measure the phosphors of your particluar display, as this requires either a spectroradiometer or a colorimeter. You can get round this if you have published data for your display's CIE xy chromaticity coordinates of each phosphor and the white point. Since the CIE Y tristimulus value always has a value of one you can calculate CIE XYZ for the white point and then (assuming additivity) CIE XYZ for the three phosphors by solving the three simultanous equations.
[The white point of a display system is the displayed colour that is produced when all three channels are driven to maximum. (eg RGB = 255, 255,255). The white point is usually expressed as either CIE xy chromaticity coordinates or a correlated colour temperature in Kelvin.]
There can be problems with converting between RGB and XYZ which result in differences between values calculated and those measured from the screen. Assuming that the correction for the display gamma is correct and that you have the right CIE XYZ tristimulus values the following may apply:
spatial non-linearity
The colour on a CRT display often differs with the spatial location across the faceplate.
channel dependence
There may be interactions between channels, for instance the green signal may cause excitation in the red phosphors.
spatial dependence
The exact displayed colour often depends on what else is being displayed on screen at the same time. For instance a central red patch will have a different colour depending on whether the surround is black or white. (Note this is in addition to visual effects in the HVS.)
lack of additivity
Many displays do not strictly obey the rules of additivity, the sum of the measurements of red green and blue differs from the measured white. Ideally they should be identical. (See section 3).
These errors mean that although greater accuracy can be obtained by using the actual display system transfer function rather than gamma (which is an approximation) the effort probably isn't worth it. See Berns et al for a details of possible problems and descriptions of some solutions, also Sproson for more detailed theory of RGB to CIE conversions in television systems.