i
i
i
i
i
i
i
i
21.2. Color Spaces 543
Other color spaces can then be defined in terms of their relationship to CIE XY Z,
which is often specified by a specific transform. For instance, linear and additive
trichromatic display devices can be transformed to and from CIE XY Z by means
of a simple 3 × 3 matrix. Some nonlinear additional transform may also be speci-
fied, for instance to minimize perceptual errors when data is stored with a limited
bit-depth, or to enable display directly on devices that have a nonlinear relation-
ship between input signal and the amount of light emitted.
21.2.1 Constructing a Matrix Transform
For a display device with three primaries, say red, green, and blue, we can mea-
sure the spectral composition of the emitted light by sending the color vectors
(1, 0, 0), (0, 1, 0),and(0, 0, 1). These vectors represent the three cases namely
where one of the primaries is full on, and the other two are off. From the measured
spectral output, we can then compute the corresponding chromaticity coordinates
(x
R
,y
R
), (x
G
,y
G
),and(x
B
,y
B
).
The white point of a display is defined as the spectrum emitted when the color
vector (1, 1, 1) is sent to the display. Its corresponding chromaticity coordinate is
(x
W
,y
W
). The three primaries and the white point characterize the display and
are each required to construct a transformation matrix between the display’s color
space and CIE XYZ.
These four chromaticity coordinates can be extended to chromaticity triplets
reconstructingthe z-coordinatefrom z =1−x−y, leading to triplets (x
R
,y
R
,z
R
),
(x
G
,y
G
,z
G
), (x
B
,y
B
,z
B
),and(x
W
,y
W
,z
W
). If we know the maximum lumi-
nance of the white point, we can compute its corresponding tristimulus value
(X
W
,Y
W
,Z
W
) and then solve the following set of equations for the luminance
ratio scalars S
R
, S
G
,andS
B
:
X
W
= x
R
S
R
+ x
G
S
G
+ x
B
S
B
,
Y
W
= y
R
S
R
+ y
G
S
G
+ y
B
S
B
,
Z
W
= z
R
S
R
+ z
G
S
G
+ z
B
S
B
.
The conversion between RGB and XYZ is then given by
⎡
⎣
X
Y
Z
⎤
⎦
=
⎡
⎣
x
R
S
R
x
G
S
G
x
B
S
B
y
R
S
R
y
G
S
G
y
B
S
B
z
R
S
R
z
G
S
G
z
B
S
B
⎤
⎦
⎡
⎣
R
G
B
⎤
⎦
.
The luminance of any given color can be computed by evaluating the middle row
of a matrix constructed in this manner:
Y = y
R
S
R
R + y
G
S
G
G + y
B
S
B
B.