Color in Computer Graphic
Color in Computer Graphic
Colour
in
Computer Graphics
Student Notes
C. Lilley
F. Lin
W.T. Hewitt
T.L.J.Howard
1 Introduction ............................................................................. 1
University of Manchester i
4.5 Other colour models ......................................................... 42
C Glossary ............................................................................... 89
Firstly, we look at how colour is seen. This draws together information from such
diverse disciplines as physics, optics, physiology, neurology and psychology to
show that colour is an internal, subjective sensation rather than an external, ob-
jective entity. This helps explain just what colour is.
Given the biological basis of colour, how can it be measured and standardised?
The second section explains how colour is measured and introduces the CIE in-
ternational standard, used to define colour. This provides the vital link between
biological sensation and physical measurement. Examples are also given of how
colour measurements can be used and manipulated, such as predicting the result
of a colour mixture or designing displays for people with defective colour vision.
An abstraction called a colour model is used to specify colour. The third section
explains the concept of primary colours and then examines the many colour mod-
els that are available, and the particular strengths and weaknesses of each. A
colour described in one colour model can often be converted to a description in
another. The CIE standard functions as a universal yardstick in this process.
The final section provides guidelines for using colour. Rather than presenting an
arbitrary series of rules, the intention was to show how the guidelines follow di-
rectly from the material presented in the preceding sections.
technical term
University of Manchester 1
2 Seeing in colour
Wavelength (m)
4
10
Long wave radio
Ultra violet
2
10 300
-6 Red
10 700
Visible light
-8
10 800
X rays Infra red
-10
10
University of Manchester 3
The ranges of wavelengths which broadly correspond to the colours of the spec-
trum are shown in Table 1 and Plate 25.
White light consists of a mixture of all the visible wavelengths, which was first
described by Sir Isaac Newton in the Optiks (1704). He found that white light
could be split by a glass prism into a rainbow of colours, and combined again to
form white. He also found that individual colours could not be further subdi-
vided.
2.2 Spectra
It could be imagined that measuring the intensity of light emitted or reflected
from an object at all visible wavelengths would completely define its colour. Such
a measurement will indeed define those optical properties which influence the
observed colour. An example of such a measurement is given in Figure 2. There
is no easy way to predict the visual appearance from this information. The domi-
nant wavelength can readily be identified, but what of the contribution from
the rest of the spectrum? What will the overall colour be?
Relative reflectance
0.2
0.1
0.0
400 500 600 700
Wavelength (nm)
Conjunctiva
Zonula Retina
Aqueous humour
Fovea
Lens
Pupil
Cornea
Iris
Optic nerve
University of Manchester 5
Eye Video Camera Function
The major optical power of the eye comes from the transparent, curved cornea,
which can bend light because of the large change in refractive index between air
on the outside and the liquid (aqueous humour) on the inside. This delicate com-
ponent is covered by the conjunctiva to prevent scratching from small particles
such as grit, dust and smoke; tears are continually secreted to wash the
conjuctiva, and the combination of eyelashes, eyelids and the bony structure of
the skull protect the eye against more major damage.
The iris is a muscle which, when contracted, covers all but a small central por-
tion of the lens, blocking the majority of light and increasing the depth of field.
This provides a greatly increased dynamic range of usable viewing conditions,
from very dim to very bright. The process of responding to a large change in over-
all light intensity is termed adaptation.
Because the refractive index of the lens and aqueous humour varies with wave-
length, different colours require slightly different lens positions for crisp focus.
This is termed chromatic aberration, and is noticed by a blurring of focus
when colours of widely separated wavelength are seen side by side.
The cells making up the retina are specialised nerve cells, and are related devel-
opmentally and morphologically to the nervous tissue in the brain. Thus, some of
the retinal nerve cells perform visual processing even before the signals have left
the eye. Another curious consequence of the embryological development of the
eye from brain tissue is that the retina seems ‘inside out’; as Figure 4 shows,
light has to pass through the ‘wiring’ of nerve cells to reach the photosensitive
cells, which are at the back face of the retina.
Light
The light sensitive receptor cells at the back of the retina face onto a black lining,
the choroid, which enhances contrast by eliminating internal reflections and pre-
venting light filtering through the front of the eyeball. Receptors are connected
via bipolar cells (so called because of their double-ended shape) to ganglion nerve
fibres, which pass out of the eye to form the optic nerve leading to the brain.
The retina also contains horizontal cells, which connect small clusters of recep-
tors. When a receptor is illuminated, adjacent receptors are made less sensitive
by the horizontal cells, increasing the local contrast. This is a preliminary form of
edge detection, and causes an optical effect known as Mach banding. This is il-
lustrated in Figure 5, which shows a series of grey rectangles. Each is a uniform
University of Manchester 7
shade of grey, but the edge near the darker rectangle looks lighter. Similarly, the
edge near the lighter rectangle looks darker. Mach banding can be troublesome
in computer graphics; if a smooth gradation in lightness is simulated by a small
number of shades, ensure that the edges are ragged to reduce this effect.
Figure 6: Schematic diagram of human rod (left) and cone (right) cells.
The light sensitive pigment in rods, called rhodopsin, is a protein bound to a form
of vitamin A. Absorption of a single photon of light causes a molecule of rhodop-
sin to change from a low energy to a high energy form. This small energy change
is greatly amplified by a cascade of chemical reactions, to produce a nervous sig-
nal. Unlike most nerve cells, which transmit impulses in a digital, on/off form,
the receptor cells produce a graduated, analogue response to light intensity,
rather like a light meter.
At low light levels, when the eye is dark adapted, only the rods are active. This is
termed scotopic vision, and is most sensitive in the green region, at 510nm. In
brighter light, rods are overloaded and the cones are active; the maximum lumi-
nous efficiency for this photopic vision shifts to the yellow/green region at
555nm. This effect is termed the Purkinje shift.
1.0
Scotopic vision
Photopic vision
0.8
Relative luminous efficiency
0.6
0.4
0.2
0.0
300 400 500 600 700 800
Wavelength (nm)
University of Manchester 9
pigment and thus in the range of wavelengths of light to which they are sensi-
tive. Referred to as S, M and L cones (for short, medium and long wavelengths)
they have maximal sensitivities at 445nm (violet), 535nm (green) and 570nm
(yellow). They are also called β, γ and ρ cones by some authorities.
An example of one set of measured spectral sensitivities for the three cone types
is shown below in Figure 8. It is immediately apparent that S and M cones dis-
play significant overlap and have similar sensitivities and wavelength maxima;
L cones have a much lower sensitivity.
0.8
L cones
M cones
0.6 S cones
Relative sensitivity
0.4
0.2
0.0
400.0 500.0 600.0 700.0
Wavelength (nm)
Examination of the data on a log scale Figure 9 shows that all three cone types in
fact have similar, low sensitivities in the blue and purple region, but L cones do
not have the large, short-wavelength sensitivity peak possessed by S or M cones.
-1.0
-3.0
-4.0
-5.0
400.0 500.0 600.0 700.0
Wavelength (nm)
One consequence of the marked overlap between M and L cones is that their re-
sponses to a given colour will be highly correlated. Transmitting the signals from
each cone type straight to the visual cortex in the brain would therefore be ineffi-
cient, It would also require four separate signals - S, M, L and brightness. What
happens instead is a current topic of research and debate. All researchers seem
to agree, however, that colour difference signals are produced.
Most researchers agree that in a second stage of colour detection, the difference
of the M and L cones is used to provide a signal which discriminates between or-
ange and bluish green.
The sum of the M and L cones is also transmitted, to provide a brightness chan-
nel. Rods, which are saturated at photopic light levels, provide a small and
effectively constant input to this channel, but there seems to be no input from S
cones.
These three stages – detection by rods and cones, initial combination and final
combination – are shown in Figure 10. The thickness of each line gives an idea of
the contribution of each factor. For example, the contribution of S and M cones to
the second stage greenish yellow / purplish blue channel is about equal, with a
smaller contribution from L cones.
University of Manchester 11
rod
S M L
+/- - +
+ -
yellow/blue red/green black/white
The nerves and blood vessels which cross most of the retina, and through which
light must pass to reach the photoreceptors, are pushed aside from the fovea to
reduce blurring. Extra large M and L cones are packed into the fovea in a hex-
agonal tiled pattern, to give the maximum spatial resolution for the lightness
(M + L) and orange/bluish-green (L – M) second stage channels. Less than two
percent of the foveal receptors are S cones, as these make no contribution to the
lightness channel. A consequence of this low S density is that the spatial resolu-
tion - the amount of fine detail that can be seen - is much lower for blues and
violets than for other colours.
700
546.1
435.8
700
546.1
435.8
University of Manchester 13
Figure 11 shows the experimental set up for a colour matching experiment.
Lights are projected onto a diffuser, shown as a grey rectangle in the figure, so
that the observer sees a uniform single colour. The unknown light to be matched,
marked ‘?’, is viewed side by side with the three standard lights, the intensities
of which are individually varied until the colours are seen to match.
Three lights often chosen for colour matching experiments are monochromatic
(single wavelength) sources at 700nm (scarlet red), 546.1nm (yellowish green)
and 435.8nm (bluish violet). These are shown in Figure 11 and Plate 26.
The green and blue-violet lights correspond to sharp peaks in the spectrum from
a mercury vapour lamp; this allows calibration and exchange of experimental
data between different sites. The red light is in an area of the spectrum where
changes in wavelength produce little change in perceived colour, minimising the
effect of mis-calibration.
In some cases, a match can only be obtained by adjusting the unknown colour;
this is done by adding a proportion of one or more of the standard lights using a
second set of standard lamps, shown greyed in Figure 11. This is equivalent to a
negative quantity of one or more lights being required. The specification of a col-
our in terms of the amounts of energy required from each of the three lights to
match it is termed its tristimulus value.
3.1.2 Additivity
The colour resulting from two coloured lights can be exactly predicted; it is the
sum of the tristimulus values of the two lights. The tristimulus value of a 50-50
mixture of two lights is thus the average tristimulus value.
X
1.50 Y
1.00
0.50
0.00
350.0 400.0 450.0 500.0 550.0 600.0 650.0 700.0 750.0
Wavelength (nm)
The three primaries are called X, Y and Z. A graph of the amounts of each CIE
primary required to match any pure spectral colour is called the matching func-
tion, and is shown in Figure 12. To match a particular colour, a vertical line is
drawn at that colour’s wavelength and the quantities read off from the intersec-
tions with each matching function. For example, to match the blue/violet colour
of wavelength 450 nm requires 0.33 units of X, 0.04 units of Y and 1.77 units of
Z.
In mathematics, many problems are made easier by the use of imaginary num-
bers, which contain the square root of minus one. Similarly, the X, Y and Z
primaries used to define the standard observer are ‘imaginary’ colours, in that
they do not correspond to visible colours. They have the property of being consid-
erably more saturated than real colours, so that no real colour requires a
negative contribution from any of the primaries for a colour match. X is a super-
saturated purplish red; Y is a supersaturated form of the real spectral green of
wavelength 520nm, and Z is a supersaturated form of the real spectral blue of
wavelength 477nm. Also, the spectral matching function of the Y primary was
chosen to exactly match the CIE standard photopic luminous efficiency function
shown in Figure 7. It therefore carries all the luminance information about the
colour.
The assumptions made in defining this observer were that the colour subtends a
visual angle of 2° or less and the illuminant is not too dissimilar to daylight.
These are easy conditions to meet in practice. The restriction on angular size is
so that the image of patch of colour on the retina falls on the fovea, the area most
sensitive to small changes in colour. This is the usual situation when looking at a
coloured object. For those occasions – rare in practice – where wide field colour
specification is required, the CIE 1964 Supplemental Observer should be used.
The experiments which were performed to define the 1964 observer used a 10°
field, so the resulting CIE values are denoted X10, Y10 and Z10. The shape of the
matching functions is broadly similar to the 1931 Standard Observer, although
tristimulus values calculated from the two observers are different and should not
be mixed.
University of Manchester 15
Because the standard observer is a mathematically defined set of functions, the
results of colour matching experiments can be simply calculated without actually
having to do the experiment. Colour measurement can thus become an auto-
mated process.
Surface gloss
Illuminant Emitted colour
reflected colour
Light source
= = =
Σ Σ Σ
X Y Z
Figure 14: Calculation of CIE tristimulus values.
Wavelengths from 400nm (violet) to 700nm (red) are shown; note that the wave-
length spacing is not at all even. The straight line connecting the ends of the
spectral locus corresponds to additive mixtures of the red nearest infrared and
the violet nearest ultraviolet to produce purple.
University of Manchester 17
Y
520nm
500nm 600nm
700nm
Z 400nm
3.5 Illuminants
Many objects are coloured which do not themselves emit light. The colour is due
to reflection of light from other light sources. The object absorbs varying amounts
of light of each wavelength, and the unabsorbed portion is reflected back to the
eye to give the sensation of colour. Clearly, the quality of light illuminating the
object will affect the perceived colour.
3.5.2 Illuminant C
The CIE have produced such a standard, called illuminant C. This consists of two
parts:
While this arrangement is suitable for laboratory use, the light output is fairly
low and the liquid tank inconvenient. Furthermore, Illuminant C is lacking in
the near ultraviolet region, making it less useful for fluorescent materials. Rec-
ognising this, the CIE has specified another class of daylight illuminants which
rectify these deficiencies.
University of Manchester 19
Illuminant A
Illuminant C
Illuminant D65
2.0
Relative intensity
1.0
0.0
300.0 400.0 500.0 600.0 700.0 800.0
Wavelength (nm)
The spectrum of D65 is complex, and difficult to reproduce exactly with an artifi-
cial light. There is no actual apparatus specified as part of the standard. Instead,
there is a procedure to determine how good a particular light is at giving the
same colour matching results as D65.
A number of selected paint samples are measured under the light in question
and their tristimulus values compared to theoretical values calculated from the
reflectance spectrum of each paint chip and the spectrum of D65. The results
from each chip are combined to obtain an overall index of colour matching fidel-
ity. Over 90% is a good result, below 60% will give significant errors.
The phenomenon of two samples matching in colour under one illuminant but
not another is called metamerism. The CIE procedure is designed to minimise
metamerism between the theoretical D65 and practical implementations of it.
Illuminant D65
Fluorescent striplight
4.0
Relative intensity
2.0
0.0
300.0 400.0 500.0 600.0 700.0 800.0
Wavelength (nm)
3.6.1 Adaptation
The visual appearance of a white surface, such as a piece of paper, varies slightly
when seen under different illuminants, but still looks white. In contrast, the
University of Manchester 21
measured spectrum and tristimulus values will vary considerably. This phe-
nomenon is termed colour constancy and is due to complex visual processing
in the brain which tries to correct for slow changes in overall light level and qual-
ity. This is dependent on the overall state of adaptation of the eye. For example,
a white sheet of paper will look white under the orangish glow of a tungsten light
bulb or the bluish glare of a fluorescent striplight. This is because the illuminant
fills the whole field of vision and provides the dominant adaptive stimulus. If a
photograph is taken of the paper under tungsten light, there will be a marked
orange tint to the white paper when the print is developed. This is because the
amount of light reflected from the photograph is a small fraction of the total light
entering the eye, which does not therefore adapt to it.
Substances which absorb ultraviolet and emit blue light are used in some wash-
ing powders; the blue neutralises the yellowish tint of residual soiling to give the
illusion of white. Such substances are termed optical brighteners.
3.7 Chromaticity
It is often useful to examine the colour of a sample separately from its bright-
ness. To do this, the tristimulus values are normalised:
y = Y / (X + Y + Z)
z = Z / (X + Y + Z)
Z
Figure 18: The X + Y + Z = 1 plane on the CIE 1931 XYZ diagram.
The resulting diagram is called the CIE 1931 chromaticity diagram, and is
shown in Figure 19 and in Plate 29. It represents the perceptual attributes of
hue and saturation, separated from luminance.
University of Manchester 23
525
0.8
550
0.6
500 575
y 0.4 600
660-780
0.2
475
450
0.0
0.0 0.2 0.4 0.6 0.8
x
Figure 19: The CIE 1931 chromaticity diagram
Remember that in Section 3.1 (page 13) colour matching experiments used spe-
cific calibrated wavelengths for yellow/green and blue/violet lights, but red light
was chosen to be in a wavelength range where mis-calibration would not affect
the colour. Looking at Figure 19, notice that colours from 660nm (red) right up to
780nm, the limit of visible colour bordering on infra-red, are at the same place on
the chromaticity diagram; they are all the same hue. A similar ‘bunching up’ of
wavelengths occurs at the border of violet and ultraviolet (380nm).
One problem with this diagram is that it is not perceptually uniform. In other
words, the distance between two colours which are just noticeably different var-
ies across the surface of the diagram.
Also known as the u′v′ diagram, from the labels on its axes, this is a projection of
CIE 1931 XYZ space designed to produce much less distortion than the xy dia-
gram. (The curious ‘dash’ notation is intended to distinguish it from a similar
(uv) diagram which was used prior to 1976.) The axes are calculated as follows:
The resulting diagram, shown below in Figure 20, is of the same general shape
as the 1931 chromaticity diagram but stretched to give a more uniform distribu-
tion of colours.
v’ 0.4
0.2 475
450
400
0.0
0.0 0.2 0.4 0.6
u’
Figure 20: The CIE 1976 uniform chromaticity scale diagram
University of Manchester 25
525
0.8 dominant wavelength 540 nm
550
0.6
500 575
sample
y 0.4 600
D65 whitepoint
660-780
0.2
475
450
0.0
0.0 0.2 0.4 0.6 0.8
x
Figure 21: Dominant wavelength calculation
In other words, the sample colour is made from the additive mixture of 40% spec-
tral light of wavelength 540nm, and 60% of D65 white at the same luminance.
Although people with an atypical colour response are often called ‘colour blind’,
there are in fact very few people who have absolutely no colour perception. The
proportion of the population with reduced colour discrimination is however sur-
prisingly large. Atypical colour response is sex-linked; while being found quite
rarely in Caucasian females and non Caucasians, it occurs in 8% of Caucasian
males.
People with normal colour vision are termed trichromats because they have three
functional cone types. Those with reduced functioning of one cone type are called
anomalous trichromats.
Dichromats will see certain colours as the same which are clearly different to tri-
chromats. These confused colours lie along straight lines on a chromaticity
diagram, converging on a single point.
As one would expect, there are three types of dichromatism, depending on which
one of the three cone types is affected. Each type has a different confusion point.
675-780
0.4
v’
0.2
475
450 400
0.0
0.0 0.2 0.4 0.6
u’
University of Manchester 27
0.6 525 550
575
600
500
675-780
0.4
v’
0.2
475 D at
u’ = -4.75
v’ = 1.31
450 400
0.0
0.0 0.2 0.4 0.6
u’
Figure 23: Deuteranopic confusion lines.
675-780
0.4
v’
0.2
475
450
0.0
0.0 0.2 T 0.4 0.6
u’
Figure 24: Tritanopic confusion lines.
University of Manchester 29
4 Colour models
If the primaries can be negative and are not constrained by hardware, any pri-
maries can be used. A single primary is represented by a point on a chromaticity
diagram; it can only produce that one colour at varying intensities. Two prima-
ries produce a line segment on a chromaticity diagram, as shown in Figure 25.
Any colour on that segment can be produced by a non-negative mixture of the
two primaries. If negative values for primary colours are allowed, the line seg-
ment can be extended out from each primary to the spectral locus as shown by
the dotted line in Figure 25; any colour on this line can be specified.
University of Manchester 31
0.6 525 550
575
600
675-780
500
0.4
B
v’
0.2 475
450
400
0.0
Figure 26 shows how a third primary C can be used to cover the entire visible
area; on the line joining A and B the contribution from C is zero; on the side to-
wards C, the value of C is positive and on the other side it is negative.
0.4
B
C
ne
C ga
v’
tiv
e
C
0.2
ze
475 ro
C
po
sit
450 iv
e
400
0.0
Three primaries define a plane, and so any visible colour can be specified with
any arbitrary choice of primaries provided negative values are allowed. Figure 27
shows three random primaries - a yellow (A), a purple (B) and a turquoise (C)
can be used in this fashion. Note the large areas that require one or more prima-
ries to be negative.
B-
A C-
0.4
All + B
A-C-
C
v’
A-B-
0.2 475 A-
450
400
0.0
If primaries cannot take negative values, only colours within the central triangle
can be produced. In this case, it makes sense to maximise the area of this trian-
gle by aligning it with the broadly triangular shape of the chromaticity diagram.
This gives one primary somewhere near the far red corner, one in the green cor-
ner and one near the far violet corner.
Another way to increase the range of colours is to use more primaries. Figure 28
shows a system with five primaries. All colours within the pentagon can be pro-
duced in more than one way. Removing any one primary reduces the number of
colours that can be produced.
0.4 C
E
v’
D
475
0.2
450
400
0.0
University of Manchester 33
4.3 CIE colour models
Y
520nm
500nm 600nm
700nm
Z 400nm
L* = 116 (Y/Yw)
1/3
– 16 for most values of Y (Y/Yw > 0.008856) or
Yw is the Y tristimulus value for the reference white, in other words that white
to which the eye is adapted. For most purposes, a standard illuminant such as
D65 is used as the reference white.
u* = 13 L* (u’ - u’w )
v* = 13 L* (v’ - v’w )
where u’w and v’w are the UCS coordinates of the chosen reference white.
These formulae correspond to translating the origin of the UCS diagram to the
white point and scaling the relative chromaticity co-ordinates by the lightness so
that the geometrical distance between two colours is reduced as they are made
darker. This takes account of the fact that dark colours look more alike than
light ones, even when the chromaticities are the same. The resulting colour space
therefore forms a cone-like solid. Black, at L* = 0 is thus a single colour at the
apex of this cone.
University of Manchester 35
L*
-600
u*
-200 200 500
v*
Figure 31: The CIE 1976 (L*u*v*) colour space.
As the spectral colours form a loop around the origin, it is possible to define a
hue angle huv which specifies hue with a single numerical value. The positive u*
axis is defined to be 0°, and angles are measured anticlockwise.
Lightness, chroma and hue angle define an alternative, polar form of CIELUV,
shown in Figure 32. This is easier to use for mixing colours than CIELUV.
C*
v* H
u*
S* = C* / L*
Figure 33 shows planes of constant chroma and constant saturation in CIE LCH
space. Chroma is clearly seen as independent of lightness.
L*
constant
saturation
v*
constant chroma
u*
The CIELUV model, because of its greater perceptual uniformity than other
models, has been used in the film and TV industries and is finding increasing use
in computer graphics. It is generally used for emissive colours such as lights or
computer monitors. Conforming PHIGS and PHIGS PLUS implementations are
required to support this model.
University of Manchester 37
4.3.3 1976 CIELAB
An alternative colour model is recommended by the CIE for reflective colours
such as paints or dyed fabrics. It is optimised for quantifying the colour differ-
ence between two samples of nearly identical colour, such as between two
batches of dyestuff, and producing similar numerical results to other existing col-
our difference formulae. The lightness parameter is the same L* as in CIELUV,
but the other two are:
1/3
a* = 500 [ (X/Xw)1/3 - (Y/Yw) ]
1/3
b* = 500 [ (Y/Yw)1/3 - (Z/Zw) ]
Because of the cube roots in these equations, there is no chromaticity diagram for
CIELAB. Straight lines in CIE 1931 xy space remain straight in the UCS, but
would not in a chromaticity diagram based on CIELAB. It would therefore not
represent additive mixture.
Since 1976, more complex non-Euclidean formulae have been devised for colour
difference in CIELAB which add varying weights of lightness, hue angle and
chroma depending on the region of colour space in which the samples lie. These
formulae are used in high precision industrial applications
Because reflective colours are being specified or measured, the illuminant used
should also be stated. In general, D65 is used unless there is some special reason
to select another illuminant. Both CIELUV and CIELAB assume that the
illuminant, or reference white, is close to natural daylight.
CIELAB has a polar form called L*C*abhab, the subscripts serving to distinguish
it from the polar form of CIELUV. The formulae are identical.
One strength of the RGB colour space is that it is a unit cube, and thus all possi-
ble values of R,G,B correspond to realisable colour. This makes it convenient
from a programming point of view, in that range checking is straightforward.
Red
Magenta Yellow
White
Black
Blue Green
Cyan
A major weakness is that colours specified in RGB space are not at all
perceptually uniform, and it is not sensible to measure colour differences in RGB
space. This colour model is further discussed in Section 5.1, (Displaying colour).
If the chromaticity coordinates of the monitor phosphors are known, and also
both the chromaticity and luminance of the white produced by equal quantities of
red, green and blue, it is possible to interconvert between RGB and the CIE col-
our spaces. This conversion is described in Appendix B.
RGB colour space is widely used in computer graphics and is supported by GKS,
PHIGS and most other graphics systems. It is adequate for use in situations
where producing different colours is more important than portability or repro-
ducibility. Specifying colour in RGB space is more convenient if hue, chroma and
University of Manchester 39
lightness are separate parameters. There are two transformations of RGB space
used to achieve this: HLS and HSV. These will be considered next.
The space, shown in Figure 35 and in Plate 32, is a cylinder centred on the achro-
matic axis. Value is the distance along this axis, saturation is the radial distance
from it. Hue is an angular measure with 0 representing red and 180 representing
cyan (a greenish blue).
Because HSV uses saturation rather than chroma, the perceived change in colour
as saturation varies between 0 and 1 is less for dark (low value) colours than for
light (high value) colours. To compensate for this, the HSV colour space is often
shown distorted to form a cone rather than a cylinder. Other diagrams show
HSV as a hexcone, to reinforce the link with RGB. However, saturation still
ranges from 0 to 1 regardless of value or hue so these changes do not represent
the geometric space accurately.
Green Yellow
White
Cyan Red
Blue Magenta
S H
White
S H
L
Green Yellow
Cyan Red
Blue Magenta
Black
HLS, like HSV, is simply another representation of RGB space. These 2 colour
models may optionally be supported in a PHIGS implementation – they are de-
fined but a conforming implementation need not support them.
University of Manchester 41
4.4.4 Cyan, Magenta and Yellow (CMY)
CMY is sometimes presented as a colour space, and corresponds to the input
data for colour printing. However it deals with the proportions of real pigments
rather than abstract colours. Furthermore, mixing two colours is not additive,
which makes the representation of CMY as a geometric solid of little value.
Specification of colours in CMY, even when the CIE tristimulus values of the
inks are known, is complicated by a great many factors as will be seen in Section
5.5. A variation of CMY adds black ink, and is called CMYK. (Black is referred to
as K rather than B to avoid confusion with blue in RGB).
Y
P/
R/
le
Purp w
Yello
B/P
Y/G
Blu
G
re
e
G/B
en
Figure 37: The Munsell hue wheel
Value is specified by an integer greater than 0 (black) and less than 10 (white).
Chroma is the radial distance from the achromatic axis, and ranges from 2 to 14
or more; the book has samples at steps of two. All colours with a chroma of 0 are
on the achromatic axis and do not have a hue. An example of a colour specified in
the Munsell system is 5.0PB/4/10 which means a purple-blue with value 4
(darker than a mid grey) and chroma 10 (very colourful, near the maximum at-
tainable pigment limit for that colour). CIE values for all the patches, measured
using Illuminant C, have been published; this particular colour has chromaticity
values of x=0.1773, y=0.1659, and Y=0.1200 for example.
Designed by the artist Albert Munsell, this system relies on the subjective selec-
tion of hues for perceptual uniformity rather than a colorimetric approach. The
original selection of colours was entirely ‘by eye’. Comparisons of the Munsell
system with CIELUV and CIELAB show that, while none of these systems is
completely perceptually uniform, the agreement between them is surprisingly
close.
Colours in the Munsell system correctly separate out chroma and value. For ex-
ample, a medium yellow such as 5.0Y has maximum chroma at a high value; this
corresponds to the observation that the purest intense yellow is a light colour.
The diagram below is intended to give the idea of the Munsell system, and de-
picts two pages arranged about the achromatic axis. It is also shown in colour
Plate 34.
University of Manchester 43
5PB 5Y
Value
Chroma
Figure 38: A pair of leaves from the Munsell system
The three parameters of NCS space are hue (φ) blackness (s, from the German
Schwarz) and chromaticness (c). Hues are specified as a percentage of two of the
four colours. For example, a lime green might consist of a mixture of 65% yellow
and 35% green. This would be written as Y35G. The relationship of all colours of
a given hue, φ to the achromatic axis can be drawn on an equilateral triangle.
The distance of a particular colour from each edge may be expressed as a per-
centage; the percentages of white (W) black (S) and the hue (F) will always add
to 100, so it is customary to omit the percentage of white. NCS is shown in Fig-
ure 39 and Plate 36.
φ
B Y
Blackness
Y35G
S
Chromaticness G
Plotting the NCS colours on a CIE UCS shows that chromaticness is fairly uni-
form, but hue is not; there are more colours in the blue to red quadrant than the
others. This means that complementary colours selected with NCS will not be
the same as those selected with CIELUV or Munsell colour models.
NCS has been used in some paint catalogues for the painting and decorating
trade. Accordingly, it may occasionally be encountered in architectural visualisa-
tion work.
University of Manchester 45
4.5.5 OSA cubo-octahedron
The Optical Society of America have designed a colour space which avoids the
uneven spacing of hue wheel systems. It is based on a rhombohedral crystal lat-
tice structure, where each point has twelve closest neighbours in 3D. The unit
solid which stacks in this fashion is a cubo-octahedron (a cube with all eight cor-
ners sliced off). This space lattice provides an even sampling of the colour space,
and allows samples to be readily ordered in planes which are not parallel to the
axes. This is intended to help designers see new scales and arrangements of col-
our.
The three parameters in the OSA model are lightness (L), yellowness (j, French
jaune) and greenness (g). The selection of colours for the lattice points was the
result of over thirty years of colour matching experiments. D65 is used as an
illuminant and, unusually, the CIE 1964 supplementary observer is used. This
poses problems for the use of OSA in a computer graphics system, because moni-
tor chromaticities are measured for the 1931 standard observer.
4.5.6 TekHVC
This relatively new system is a development of the polar coordinate L*C*Huv
form of CIELUV. It has three parameters:
H = Huv - offset
V = L*
C = 7.50725 C*
where offset is the angle in the CIE UCS between the u’ axis and the line joining
the selected white point to a particular ‘best’ red. This means that a hue angle of
0° always points to this red regardless of the white point. However, a hue angle
of 90° will still point at different colours as the white point is changed. The scal-
ing factor is intended to make the visual effect of a change in C the same as that
of a similar change in V or H.
The X11 named colour list has largely been superseded, from X11R5 onwards, by
the much more comprehensive colour management services (Xcms). This allows
the specification of colour as RGB, HLS, CIEXYZ, CIExyY, CIELUV, CIELAB,
CIEu’v’Y or TekHVC and provides interconversion routines between these. The
chromaticity coordinates of the monitor phosphors and white point have become
a property of the root window, inherited by all other windows.
4.5.9 Pantone
This is a proprietary system for specifying colour, widely used in the commercial
graphic design world. Originally it specified a large series of pigments for spot
colour. This has now been extended to the Pantone process colour range
which relates colours to percentages of standardised, Pantone certified cyan, ma-
genta, yellow and black process inks used with standardised screen angles. The
process colours can vary markedly from the ‘equivalent’ spot colour.
University of Manchester 47
such as adaptation, chromatic induction, and simultaneous contrast. The
Hunt-ACAM model gives numerical predictions for colourfullness, saturation, in-
tensity, lightness, and brightness.
The principle of a CRT is that one or more electron guns produce variable
amounts of electrons in response to an applied voltage. The electrons are acceler-
ated towards the front of the tube by applying a large positive voltage to a grid.
Accelerating Shadow
grids mask
The front of a colour tube is covered with three types of phosphor, which emit
red, green and blue light when hit by electrons. Monochrome and greyscale moni-
tors have only a single colour of phosphor. Electron beams from the guns are
swept from top to bottom and left to right by the deflection plates to cover the
University of Manchester 49
screen area, and the voltages applied to the three guns are varied to adjust the
intensity of the electron beam and hence the brightness of light emitted. A
shadow mask is used to ensure that the electron beam from each gun can only
fall on the appropriate type of phosphor.
• the light from the phosphors is not as saturated as a pure spectral colour
• negative values cannot be applied to the guns.
These differences mean that some visible colours cannot be reproduced on a CRT.
The range of displayable colour is termed the gamut and varies for different
makes and models of monitor. It may conveniently be depicted on a CIE 1976
UCS diagram, where it forms a triangle bounded by the monitor primaries. Each
secondary lies on the line connecting the appropriate primaries, because the col-
ours are additive. The white point should correspond to equal maximal output
from the three guns. The example below (Figure 41) shows the gamut of the
monitor on a VAXstation 3540 workstation.
0.4
v’
475
0.2
VAXstation 3540
monitor whitepoint
450
400
0.0
Figure 41: The VAXstation 3540 gamut on the CIE 1976 UCS diagram
The gamut of a monitor shrinks as the ambient light level increases, a fact which
will be familiar to anyone who has tried to use a monitor in bright sunlight. Am-
bient light is reflected back from the monitor, adding white to all colours. This
means that black becomes a dark grey. All colours move towards the white point,
the darkest colours moving most. So, as the ambient light level is increased, typi-
cally deep blues are lost first, and only the lightest colours such as yellow and
white can still be seen at high ambient light levels.
Appendix B gives details of how to calibrate a colour monitor for use with CIE
colours.
• misconvergence: the electron beam does not hit the correct pixel. This results
in blurring of the edges of shapes and upsets the colour balance; if for exam-
ple the green gun is also lighting up the red pixels to an extent, then all
greens will be tinged with yellow (the secondary colour resulting from a mix-
ture of green and red). The gamut will clearly be reduced, the position of the
green corner of the gamut triangle moving towards the red corner in this ex-
ample. Misconvergence tends to be most apparent at the edges of the display
and in older monitors. Solution: Many monitors have internal controls to ad-
just convergence. Have these adjusted by a competent service engineer. Use
a degauss button regularly, if there is one. Do not site monitors next to mag-
netic fields, such as loudspeakers or power cable conduits.
• flicker: caused by the refresh rate of the screen being too low, or the use of
an interlaced display (where the electron beam traces all the even lines, then
all the odd lines). Solution: do not use a video mode of higher resolution than
the monitor can cope with. Do not use interlaced modes.
• phosphor ageing: over a period of a year or so, the brightness of the phos-
phors will fall. Blue is affected faster than red or green. Solution: Do not rely
manufacturers data for old monitors; have the values measured. For accurate
work, use an auto-calibrating monitor.
• gun interaction: the intensity of the electron beam depends on the power be-
ing produced by the other two guns at the time. Also, the intensity of a white
pixel will be different if the rest of the screen is all white or all black, because
of power drain. Solution: avoid cheap monitors with inadequate power sup-
plies.
University of Manchester 51
5.1.4 Video circuitry
The image displayed on a computer graphics monitor is composed of a two di-
mensional array of dots, termed pixels. These are the smallest addressable
areas on the screen whose colour can be individually changed. The video image is
defined by an area of memory in the computer, the video RAM (Random Access
Memory), which in most workstations can be written to at the same time as the
video circuitry is reading from it. Graphics workstations typically write to this
memory with a mixture of both software and specialised hardware which per-
forms common tasks (such as drawing polygons). Video RAM is read
continuously by the video circuitry, which scans each pixel in turn and sends the
values as a serial stream to be converted into monitor signals.
Considering the video RAM to be a two dimensional array, displays differ in both
the size of this array and the colour resolution (number of bits per pixel). To-
gether with the physical size of the monitor, this defines the spatial resolution
(in pixels per inch) and the total number of simultaneously displayable colours.
Monochrome devices use one bit per pixel, so each pixel can be on or off, white or
black. Greyscale devices use more bits per pixel, the total number of displayable
greys being 2n, where n is the number of bits per pixel, typically 8. The binary
number stored in video RAM for each pixel in turn is accessed by the video hard-
ware and converted to an analogue voltage using a fast digital to analogue
converter (DAC) as shown in Figure 42. This voltage is used to modulate the in-
tensity of the electron beam in the monitor and so give different brightnesses.
DAC Gun
Video RAM Screen
Figure 42: A greyscale display.
Colour devices used in computer graphics typically use 24 bits to represent each
pixel. These are organised as three groups of eight, giving 28 = 256 levels of in-
tensity for each of the red, green and blue guns; 16.7 million colours in all. There
are thus three DACs. This, plus the cost of the extra memory and the colour
monitor, is why colour displays are more expensive than monochrome or
greyscale displays. The layout of a 24 bit colour display is shown in Figure 43.
Some displays, used for less demanding computer graphics applications, use only
eight bits to represent each pixel. Very few devices organise this into three
groups like the 24 bit displays; this would give far too few colours in most appli-
cations. Instead, each location in video RAM stores an 8 bit value which is used
to index into a table of 256 colours. These colours are specified to a greater preci-
sion than 8 bits; 18 or 24 is common. The total range of colours is termed the
palette; the table of selections from this palette is called the colour look-up ta-
ble, or CLUT. Single chips containing a CLUT and three DACs are available, the
combination being referred to as a RAMDAC.
Although the total number of colours in the palette can be as high as the total
number of colours in a 24 bit display, only 256 of them can be used in any one
image. This configuration is an example of indexed colour, whereas the 24 bit
display described previously is an example of a direct colour system. The layout
of an 8 bit indexed display is shown in Figure 44.
CLUT
0
1
...
255
University of Manchester 53
It is significantly faster to rewrite the data in the colour lookup table (256 en-
tries, 3 × 8 bits, so 768 bytes) than to change the colour of each pixel in video
RAM (typically 1280 × 1024 entries, 8 bits, so around 1.3 million bytes). Rewrit-
ing the CLUT can be used to provide fast animation of an image with few
colours.
A refinement of the 24 bit display uses this indexing technique for each 8 bit
group, to index into a table of (typically 12 bit) colour values. There are thus
three of these tables, one for each gun, and three 12 bit DACs are used. Whereas
the entries in the CLUT of an 8 bit indexed display are independent of one an-
other, the entries in this system are typically ordered to form a colour scale. This
allows the maximum value and response curve of each DAC to be changed, to
compensate for drift or ageing in the calibration of the monitor.
So Luminance ∝ voltage2·5
Broadcast standards in the United States of America are defined by the National
Television Systems Committee (NTSC). The NTSC standard is also used in other
countries, such as Japan. It specifies illuminant C for the white point and a
gamma value of 2·2.
The United Kingdom and Europe use standards laid down by the European
Broadcasting Union (EBU). These use a D65 whitepoint and a gamma of 2·2.
The gamuts of these three monitors are shown in Figure 45. To provide the cor-
rect colour in high quality computer graphics, the CIE XYZ values should be
converted to RGB using the SMPTE monitor chromaticities.
University of Manchester 55
0.6 525 550
575
600
500 675-780
0.4
v’
D65 whitepoint
475
0.2 Illuminant C
SMPTE monitor
EBU monitor
450
NTSC monitor
400
0.0
The formulae given below are defined in CCIR Rec. 709, the international stan-
dard for high definition television (HDTV). Older video standards have less
precise definitions for gamma correction, ignoring the infinite gain problem.
For values in the range 0.0 to 0.017, the slope of the curve is limited to 4.5:
Rγ = 4·5 R
Gγ = 4·5 G
Bγ = 4·5 B
5.2.3 Bandwidth
In computer graphics, a picture is thought of as a 2D array of pixels, each of
which can be any colour. This is simple and intuitive, and the very high speed
electronics which make this possible go unremarked most of the time. In video
recording, a picture is thought of as a waveform which shows how the intensity
or colour of the picture varies as the electron beam scans across the display. As
the lines on screen are traced sequentially, a picture in video terms is thought of
as a 1D waveform.
University of Manchester 57
To reduce flicker, the even scan lines are drawn first, followed by the odd scan
lines. This raises the effective screen refresh rate to 50 times a second, provided
there is some correlation between one scanline and the next. When the picture
comes from a camera this is often the case, but is less likely in a computer graph-
ics image. Horizontal lines which are one pixel wide will flicker noticeably. The
effective horizontal resolution is thus reduced from 575 to between 200 and 300.
This has now become standardised (CCIR Rec. 601-1) and the equivalent decoder
is built into all video recorders and TV sets.
Over the years, the phosphors used in colour televisions have changed, so that
modern sets are quite different from the NTSC primaries. To provide more useful
colour monitoring, the Society of Motion Picture and Television Engineers
(SMPTE) published a standard code of practice which defined new chromaticites,
shown in Table 3. Colour balancing is now done using the SMPTE broadcast
monitor. Because the NTSC monitor is not representative of modern broadcast
monitors or TV sets, the video‘ luminance’ signal is no longer the correct formula
to calculate the luminance which would be measured from the monitor. Apart
from making a less than optimal use of the information capacity of the system,
this does not matter. It is more important that the encoder and decoder work cor-
rectly as a pair.
Use the above formula to calculate the video luminance signal which will be re-
corded onto tape. This is the same regardless of the monitor which is being used
for colour balancing.
To calculate the actual measured luminance, for example to convert a full colour
image to greyscale, calculate directly from the chromaticities of the monitor in
question using the procedure in Appendix B. For example, for an SMPTE moni-
tor the formula would be:
Notice that the RGB values are should not be gamma corrected in this formula.
It is unfortunate that the symbol Y has these two related but distinct meanings.
The chromaticity of the video luminance signal Y is at the system white point
As an additional trap for the unwary, HDTV will use a different formula for
video luminance. Being a new standard (SMPTE 240M) for a much improved
video and broadcast system, it does not need to maintain compatibility with an
installed base of older decoders. So the video luminance encoding was calculated
from the SMPTE monitor set:
The chrominance signals are produced by subtracting the video luminance from
any two of the three (RGB) channels. Green makes the most contribution to the
video luminance, so it is the red and blue channels that are used to make
chrominance signals.
C1 = Rγ - Y
C 2 = Bγ - Y
Clearly, the chrominance signals can be positive or negative. Putting the RGB
values of the primary (red, green, blue) and secondary (cyan, magenta, yellow)
colours into these equations shows that C1 varies between ± 0·866 and C2 be-
tween ± 0·701.
Converting an RGB signal to a luminance (Y) and two chrominance (C1C2) sig-
nals is a linear, reversible process and is the starting point for all video encoding.
Of itself, it produces no limitations or distortions of colour quality, although later
stages certainly do.
University of Manchester 59
This type of system is used for professional video equipment. Examples are the
Sony Betacam system, widely used for electronic news gathering and studio qual-
ity mastering, and the Panasonic MII system.
Pb = 0·5 / (1 - 0·114) C1
Pr = 0·5 / (1 - 0·299) C2
Y = 219 Y + 16
Cr = 224 C1 + 128
Cb = 224 C2 + 128
The big advantage of digital component video is the lack of noise and the possi-
bility of many generations of copying without degeneration of the quality. Digital
component video recording equipment is however considerably more expensive
than analog component equipment.
If computer graphics are being made specifically for recording to digital compo-
nent video, the values of R G and B should be gamma corrected as floating point
values then converted directly into the range 16 to 226 rather than the usual 0 to
255. This avoids introducing two sets of round off errors.
Other systems which use YCbCr or derivatives of it include the JFIF image for-
mat from JPEG, and the PhotoCD format from Kodak.
Video luminance is combined with a composite chroma signal (which has been
modulated onto a colour subcarrier), colour burst and synchronisation signals to
form a single composite video signal ready for broadcast. The details of this proc-
ess need not concern us here, but once video luminance and chrominance have
been mixed together they can never be fully separated again, even by the best
quality decoders. There is inevitably some interference between luminance and
chrominance channels. This gives rise to many types of colour artefacts.
Composite video recorders record a broadcast signal (or some intermediate stage)
and are thus subject to the same limitations as if the signal were to be broadcast.
5.3.1 UV encoding
Formation of U and V components is the first step in preparing a video signal for
broadcast. The chrominance signals are scaled so that the sum of the video lumi-
nance and the composite chrominance is less than 1.34:
U = 0·493 C2
V = 0·877 C1
This is done so that the final composite signal stays within the safe limits of car-
rier modulation. The U and V components are then subsampled by a factor of two
to reduce bandwidth.
Some computer graphics systems designed specifically for broadcast use allow
colour specification directly in YUV. While not particularly easy to use, this does
have the advantage that untransmissible colours are not inadvertently produced.
University of Manchester 61
C = U cos(t) + V sin (t)
Figure 46 shows how the phase and amplitude of this signal correspond to the
original U and V components.
V
A
φ
U
Figure 46: Phase angle (φ) and amplitude (A) of composite chroma.
5.3.3 S Video
S video is a compromise between full component recording and composite record-
ing. Video luminance and composite chroma are recorded as two separate
signals; while there is a degradation in colour quality caused by the use of the
colour subcarrier, there is no interference between video luminance and compos-
ite chrominance.
The most common example of an S video system is S-VHS. The input connectors
are often labelled Y/C, to show that video luminance (Y) and composite
chrominance (C) are kept separate. Other formats which record separate Y and C
signals are U-Matic and Hi-8 video.
As a result of mixing the luminance and chrominance signals, some very bright,
saturated RGB colours map to signals which cannot be broadcast; either because
they overload the transmitting equipment or because they give shimmering, un-
stable colours. Although such highly saturated colours are not commonly found
in film of the real world, they are a problem in computer generated images, and
the colours must be mapped to broadcastable ones by reducing the luminance or
saturation.
The constraints on acceptable colours are firstly that the amplitude of the com-
posite chroma must be less than 53, and secondly that the sum of video
luminance and composite chroma must be less than 1·2.
Another consequence of mixing chrominance and video luminance is that the two
signals interact. High frequency video luminance information is decoded as
chrominance, giving shimmering rainbows of colour on detail such as finely
spaced lines. The colour subcarrier is incompletely removed from the video lumi-
nance information, giving a periodic variation in brightness across a scanline.
Rapid transitions in colour produce a flickering edge, an effect that can be re-
duced by smoothing the image before it is encoded.
Domestic VHS video records a composite video signal, and thus suffers from all
the defects in colour quality that have been noted for PAL broadcast. This should
be borne in mind when planning a video animation which is to be shown at a con-
ference or presentation. The most common format to use is VHS; so although the
material is never broadcast, it is subject to all the limitations of broadcast media.
As originally defined, NTSC used I and Q rather than U and V, defined by:
I = V cos(33°) – U sin(33°)
Q = V sin(33°) + U cos(33°)
This is a simple rotation and flip of the axes so that Q contains blues and violets;
as was seen in Section 2.7, these are the colours for which the spatial resolution
of the eye is poorest. To cope with a narrow available bandwidth, the Q signal is
broadcast at much lower resolution than Y or I. Considering the bandwidth of
the Y signal to be 100%, I uses 25% and Q only 10%. Modern production equip-
ment uses U and V rather than I and Q; the decoder cannot tell the difference.
University of Manchester 63
only eight colours. There are three classes of technique that can be used:
quantisation, dithering and halftoning.
5.4.1 Quantisation
Each original colour is mapped to the nearest of a subset of new colours. The no-
tion of ‘nearest’ implies that the distances between colours are measured and
compared; thus, the colours should be quantised in a colour space where the dis-
tance between points correlates with their perceived colour difference. CIE LUV
is a suitable colour space, although others can be used. Distance may also be
weighted to take advantage of perceptual effects. For example, preserving lumi-
nance may be more than preserving hue.
Sampling in RGB space should use an equal resolution for each axis. For exam-
ple, in an 8 bit system with 256 colours available, 6 levels of red, green and blue
may be used to give 216 different colours. This ensures that greys do not have
objectionable tints. Having unallocated colours may be an advantage when a
colourmap is shared between concurrent applications.
This algorithm has two distinct phases. Firstly, the colours are divided into
groups. Secondly, each group is assigned a new colour. To group colours, the
smallest rectangular, axis-aligned space is calculated that will completely en-
close all the colours. This is shown in Figure 47a, using only two dimensions for
clarity. The rectangle is cut in two across its longest axis so that the resulting
rectangles contain equal numbers of colours (Figure 47b). The process is re-
peated, shrinking each new rectangle to its smallest volume (Figure 47c) and
cutting the larger in two (Figure 47d) until enough rectangles have been pro-
duced. To assign a new colour for the group, either the centroid of the rectangle
or the group mean can be used.
c d
Figure 47: Median cut.
5.4.1.3 Histogramming
The most frequently used original colours are retained intact. The remaining col-
ours are assigned to nearest of these popular colours. It is customary to drop
some precision when constructing the frequency histogram, so that groups of col-
ours which are close count as a single colour and are assigned the group mean.
This allows other, less popular but significantly different colours to be retained
intact. Another optimisation is to leave some room in the colour map for infre-
quent colours which do not match any of the new colours well.
Whilst it is possible to construct a histogram across the entire colour space, this
requires a lot of memory. It is more common to construct separate histograms for
each axis. For example, to quantise down to 256 colours in CIELUV space one
might histogram over 50 bins in L* and 25 bins in u* and v*. This would give 2%
steps in lightness, which are just noticeable. Of these, the commonest 10 in
L*and the commonest 5 in u* and v*would be used to construct a new colourmap
with 10 × 5 × 5 = 250 colours, leaving 6 for those outliers furthest from the new
colours.
University of Manchester 65
high variance low variance
There are clearly many possible ways to partition the colour space, and it would
be impossible to test them exhaustively. Some heuristic variance based methods
therefore select a low, rather than optimal, variance. It is possible to calculate
the optimal solution by a similar method to the median cut algorithm.
A plane is swept along each of the three axes of the colour space, and at each
position on each sweep the variance on each side of the plane is calculated. The
point which minimises the variance on both sides is noted. The colour space is
then cut across whichever of the three axes gave the lowest result. This is re-
peated on the side with the largest variance until sufficient subdivisions have
been made.
5.4.2 Dithering
Dithering is most commonly encountered as a means of simulating grey scales on
a monochrome device by printing black and white. However it can also be used in
a similar manner to simulate more colours by displaying two or more colours
close together; from a distance the eye will mix these to give the effect of more
colours.
To dither an area in a given colour, the available colours that most closely resem-
ble it are selected and a percentage mixture calculated. Suppose, for example,
that an unavailable lime green is to be simulated with 70% pale green, 20%
lemon yellow, and 10% dark green. For each pixel, a random number is gener-
ated in the range 1 to 100. If it is below 70, the pixel is coloured pale green;
between 70 and 90, lemon yellow, and above 90, dark green.
Clearly this technique will give the best results when the colours to be mixed are
fairly close, and large areas are dithered. Accurate colour discrimination is in
any case less easy on small areas.
× 0.5 0·25
Because errors have both sign and magnitude, there is no net error propagated
across the image. In monochrome dithering, the error is a single number whereas
colour dithering produces three errors, one for each axis of the colour space.
There are a number of weighting schemes for diffusing errors. Figure 49 uses
Stucki weighting, for example.
Other enhancements include adding a noise function to the error, and processing
alternate lines in opposite directions; both reduce patterning.
5.4.3 Halftones
Commercial printing presses are unable to mix inks in different proportions to
achieve different colours. Instead, they lay down a grid pattern of dots for each
ink; the size of each dot is varied and from a distance, the colours appear to mix.
The dotted appearance of newspaper photographs is a familiar example of this,
using a single colour. The difference between halftoning and dithering is that the
latter keeps the same spatial resolution, whereas halftoning trades significant
amounts of spatial resolution for an increase in the number of apparent colours.
5.4.3.1 Screening
University of Manchester 67
If the grid for each colour was aligned, each ink would be obscured by the next
one to be printed as most inks are opaque. The grids are therefore rotated rela-
tive to one another. Some angles give pronounced Moiré interference patterns. It
has become conventional to use rotations of 0° for yellow, 15° for cyan, 45° for
black and 75° for magenta to avoid this, as shown in Figure 50 and in Plate 37.
These angles give small rosette patterns. Other angles are also used, often in
conjunction with different screen frequencies for each colour.
Black 45 degrees
Magenta 75 degrees
5.4.3.2 Matrixing
5.5.1 Terminology
Printing may mean one of two things:
These two procedures, although different in details, have in common that a col-
oured print is produced by mixing inks, wax, or other dyes. They can mostly be
considered equivalent, except where noted.
Printing technologies can be divided into two types. In the first, more common
type the amount of ink deposited on a particular spot has two values - some and
none. With three colours of inks, this means that only eight colours are available.
Halftoning, discussed in the previous section, is used to increase this paltry
range. Offset lithography and most laser printers, waxjets and inkjets are exam-
ples of this type. In the second type the quantity of ink deposited can be varied,
allowing a wide range of colours to be produced without any halftoning. They are
thus termed continuous tone printers, and are capable of near photographic qual-
ity. Dye sublimation printers are an example of this type.
University of Manchester 69
Surface gloss
Illuminant Emitted colour
reflected colour
Light source
This means that, in a three colour process system, the primary colours of inks
broadly correspond to the secondary colours of three colour additive mixing –
cyan, magenta and yellow - and that a mixture of all three primaries produces
black rather than white. It is also possible to print with spot colours in addition
to, or instead of, process colours. This may be done to produce colours outside a
process colour gamut, to ensure that a particular colour looks the same on differ-
ent printers, or to obtain special effects.
0.4
v’
0.2 475
450
400
0.0
0.0 0.2 0.4 0.6
u’
Figure 53: Example printer gamut
A good set of printing inks will have highly saturated colours to give a wide
gamut. The variation in coloured inks used in different printers is at least as
wide as the variation in monitor phosphors.
Although colour mixing is subtractive, the density of ink can be considered addi-
tive. Printing the full amount of cyan, magenta and yellow gives a density of
300%, and a brownish black colour. Adding black ink would give a total achiev-
able density of 400% (and a better black colour). In practice, density departs from
additivity in a number of ways, which not only alters the gamut but also greatly
complicates the colour separation process.
Because of this, the sort of gamut shown in Figure 53, though useful as a guide,
is not completely accurate. Professional printers and colour pre-press agencies
construct a more accurate gamut by measuring samples of many combinations of
inks. A test sheet containing samples with a known proportion of CMY or CMYK
is produced, and the CIE tristimulus values of each patch measured. Plate 38
shows part of such a sheet. The resulting data is used to construct a gamut and,
arranged as a 3 or 4 dimensional lookup table, is used to predict the proportions
of inks required to mix a given colour on that device.
University of Manchester 71
cies are used when high quality is desired, such as in book and magazine produc-
tion.
It was stated earlier that ink density could be considered additive. Many of these
variables are to correct for this assumption being only approximately true. Some
of the more important factors are:
• Ink adhesion. Inks are layered on top of each other, and there is a difference
in adhesion between printing on plain paper and on inked paper. This effect,
which varies depending on the order inks are deposited onto the paper, re-
duces additivity.
• Maximum density. A density of 400%, corresponding to the maximum
amount of each ink, would weaken most papers and result in buckling, tear-
ing and smearing. Because equal quantities of the three primaries will
produce a neutral gray, some or all of the common proportion of an ink mix is
removed and substituted with black. For example, the colour
C=20,M=30,Y=40 could be replaced with C=0, M=10, Y=20, K=20 or C=10,
M=20, Y=30, K=10. This is called grey component replacement (GCR).
Plate 39 shows 70% GCR.
• Gray balance. In practice, equal amounts of each primary do not produce a
pure achromatic grey. The proportions must be adjusted slightly to remove
the colour tints which would result, and to which the eye is particularly sen-
sitive. This problem, shown in Plate 40 is lessened by grey component
replacement.
• Under colour removal. Black ink is used to boost the ink density at high ink
levels to correct for additivity failure. This enhances contrast, and is per-
formed in addition to grey component replacement.
Measured density
C+M+Y+K
C+M+Y
Required density
• Press registration. This applies both to printing plates and to multiple passes
of paper inside a printer. Mis-registration alters the colour of an ink mixture
from the measured, calibrated value and can introduce colour tints into
greys. Very small amounts of mis registration can affect the final result, be-
cause the degree of overlap of halftone dots and the effective screen angles
are altered.
One problem with using a non-CMYK model is that colours can be specified
which cannot be printed on a particular device. These must be dealt with in a
device dependent way. Using a graphical colour selection tool or colour manage-
ment system, such colours can be avoided. For example, Plate 41 shows such a
tool displaying the difference between the gamut of a monitor (the Tektronix
XP29P PEX terminal, solid line) and a printer (the Tektronix 4396DX, dotted
line). The selected colour is shown in both the RGB and TekHVC colour models.
The problem of gamut mapping and the treatment of out of gamut colours is
discussed in Section 5.7
University of Manchester 73
Photographing the display on a graphics monitor gives good results, particularly
if the room is darkened to exclude reflections on the glass and a tripod is used.
The gamut of a colour film is typically large, and includes much of the gamut of
many computer monitors. This is why screen photography often provides a more
pleasing and accurate result than using a colour printer. Transparency (slide)
film has wider colour gamut and better colour fidelity than print film. Magazines
and journals tend to prefer transparencies to prints for this reason.
0.4
v’
475
0.2
D50 whitepoint
monitor whitepoint
typical transparency
450
400 HP A1097C monitor
0.0
0.4
v’
475
0.2 monitor whitepoint
D65 whitepoint
VAXstation 3540
450
Tektronix Phaser III
400
0.0
There are a number of strategies for transforming colours between the two de-
vices.
One simple solution is to use a direct mapping of RGB to RGB or CMY. This has
the advantage that each unique colour in the source gamut maps to a unique col-
our in the target gamut. However, none of the colours will be correct. For
example, using the pair of gamuts in Figure 56, the monitor blue would be repre-
sented by the printer blue. In this example, the printer blue is very close to the
line joining monitor blue with monitor red. It will thus appear as purple, a mix-
ture of those two colours.
While this direct mapping may be useful when colours are merely required to be
distinguishable, the general requirement is to reproduce the original colour with
the greatest perceived (rather than measured) accuracy.
One alternative is to use the full gamut of the first device, and approximate the
out of gamut colours that result. This is shown in Figure 57a.
Another alternative, shown in Figure 57b, is to use only those colours which are
in the intersection of the two device gamuts. This requires accurate sampling
and measurement of the gamut in the case of non additive devices such as print-
ers. It also introduces problems when colours must be generated automatically,
for example in shaded images.
A compromise solution, Figure 57c, is to bound the gamut of the first device by
some regular shape which approximates the gamut of the second device. This
limits the number of out of gamut colours that are produced, while allowing
lighting calculations to choose from a defined range of colours. Such a solution
would however severely limit the range of possible colours, and still be quite com-
plicated to implement.
University of Manchester 75
Figure 57: Gamut selection strategies.
The phenomenon of colour constancy helps to reduce the complexity of this task.
In any mapping transformation of this nature, the least noticeable change is a
saturation shift. Greyscale shifts (lighter/darker) are also not too bad provided
there are no sudden discontinuities. Overall shift in lightness of an image are tol-
erated because of colour constancy and the adaptation of the eye to different
lighting levels; white remains white.
One method is to clip all colours outside the gamut to the gamut boundaries.
This has the advantage that all colours inside the gamut are unchanged and will
appear accurate. However, as shown in Figure 58, many out of gamut colours
will map to the same colour. This plays havoc with graduated ranges of colour
such as smoothly shaded lighting effects. The discontinuities in colour relation-
ship are visually obtrusive.
Another way is to uniformly scale all colours towards the grey axis, as shown in
Figure 59, so the transformed set of colours fits within the gamut. This keeps
smooth ramps of colour intact, although the colours can loose a lot of saturation.
The hues will remain constant, however, so the image will look recognisably
similar. Non linear scaling, where colours are moved progressively more the fur-
ther they are from the grey axis, can help here.
A good method in practice is to scale so that most - 90 to 95% - of the colours fall
within the gamut. Then the outliers are clipped to the boundary. This avoids sub-
jecting the majority of colours to a substantial colour shift, just to accommodate a
few outliers.
Although this transformation can be done once, to map the entire monitor gamut
to the printer gamut, extra performance can be squeezed out of the method by
computing the transformation for each image. The image gamut, being a subset
of the monitor gamut, will hopefully have less outliers. The saturation loss can
thus be minimised. Of course this is more computationaly expensive.
University of Manchester 77
6 Usage of colour
• to distinguish objects
• to show relationship and connections between objects
• to display additional information without an increase in dimensionality
• to make clear the 3D form of an object
• to make a graphic more interesting to the viewer
• to direct attention to parts of a graphic
If colour is being assigned some coded meaning, for example in status displays or
user interface design, the number of colours should be strictly limited. Many
studies have shown that no more than six or seven colours should be used in this
fashion, and they should be clearly distinguishable. Furthermore, it is preferable
to add redundant information such as size or shape to reinforce the distinction,
as shown in Plate 42
If a continuous colour scale is being used to display the value of some variable –
such as temperature or stress – over a surface then using more colours gives a
finer gradation and enables small details to be seen. In this case, 256 colours
from an 8 bit display may well be insufficient.
For accurate work, where an exact colour match is important, use a calibrated
monitor and a viewing cabinet, with CIELUV or more specialised models such
as Hunt ACAM.
For particular applications - textiles, architecture, graphic arts - use the appro-
priate specialised colour model which is conventionally used in that application
area. For example, CIELAB, Coloroid, or Pantone respectively.
University of Manchester 79
To mix device independent colour, use a colour model with a polar coordinate sys-
tem to give a hue wheel. For example, L*C*Huv or TekHVC.
To mix distinguishable but device dependent colour, use a polar model such as
HSV or HLS.
Use RGB if it is all that is available, but consider selecting from HSV and con-
verting to RGB.
Do not use CMY directly. The number of variables which must be altered is too
large.
Different colour models use different spacings of colours round a hue wheel, so
the exact colour which is found to be the complement of another varies with the
colour model. A true perceptually uniform scale would give the correct colour.
Determining complementary colours can be readily done by eye. Simply stare fix-
edly at a small patch of colour on a black background for a minute or so. Looking
at a well illuminated white surface will produce an after image in the comple-
mentary colour. Plate 43 can be used to try this out. Note that the precise colour
obtained from an after image depends on the illuminant used.
After images are caused by the photosensitive pigment in the cones becoming
bleached as a continuous high chroma colour stimulus is applied. Staring fixedly,
without moving the eye, keeps the image on the same cells in the retina. In the
resting cell, used pigment is replenished. By not allowing this to take place, the
pigment in each cone type is depleted in proportion to the degree to which that
colour excites each cone type. For example, a green stimulus will bleach M cones
the most. Looking at a white surface will give the illusion of a pink colour until
the pigment is replenished.
A graphic which incorporates many intense unrelated colours will look cluttered
and confusing; there is no single point of focus. Using groups of related colours
If particular colours are to have individual meanings, these should be clearly ex-
plained and the colours readily distinguishable. Some colours have conventional
meanings which are widely – if not universally – understood. For example, red is
associated with action, excitement, danger, heat and stop. Such meanings are
overloaded and may be contradictory. They may also be specific to a particular
culture.
Don’t have fine detail in blue or red on dark coloured backgrounds. Why: the
photopic luminous efficiency curve is sharply peaked in the yellow and green
part of the spectrum. Colours at the spectral extremes will appear much darker
than yellows and greens at the same measured light power level. Similarly, yel-
lows and greens on a light background will have low contrast and thus be
difficult to see.
Don’t use blue or violet for small moving shapes such as mouse cursors. Why: S
cones have a slower response than M or L cones. Therefore they cannot detect
rapid changes in position of blue and violet objects. The density of S cones in the
fovea is much less than the density of M and L cones. Therefore, the spatial reso-
lution for blue objects is much less than for other colours ( a fact which, as we
have seen, is made use of by subsampling in video encoding)
Do use perceptually uniform colour spaces to construct colour scales. Why: Colour
scales with perceptual jumps can give a false impression of spurious detail. Areas
of little colour change can mask details. A perceptually linear colour scale facili-
tates estimates of the displayed parameter.
University of Manchester 81
6.4 Interpolation
The colour space chosen affects how colours are interpolated. This has bearing on
the production of colour scales for visualisation. Perceptually uniform spaces are
to be preferred to avoid discontinuities or distortions of scales. Polar coordinate
spaces are often easier to work with than Cartesian spaces.
In Plate 47, the red curve is hue, moving from red (0°) at the bottom to violet
(360°) at the top. The green curve is saturation, and the cyan curve is value. The
small filled squares represent points that can be moved, through which the curve
passes. (These are termed knots, and will be met in the Curves and Surfaces
module). The open square on the green curve represents the tangent to the curve
at the point being edited.
The oranges are desaturated to give browns, and the purples made lighter. This
colour scale was chosen to illustrate the method rather than be an example of
good practice.
Non linear colour interpolation may be used as a form of depth cueing. For exam-
ple, in the representation of outdoor scenes, distant objects can be made more
blue and less saturated. This mimics the effect of atmospheric haze.
Pseudo colour can be used to enhance detail or visualise small changes. Exam-
ples of this type of application are medical imaging, geographical information
systems, and finite element post-processing.
3. Visual calibration
The first method can have the additional refinement of measuring the value for
each gun separately.
Some monitors have internal gamma correction in hardware, and need no fur-
ther adjustment. To detect such a monitor, refer to the manual or carry out a
quick visual calibration. The majority of monitors will, however, require gamma
correction.
Using a large number of samples, and performing duplicate tests, helps reduce
random errors and give a more precise result. Each patch should be measured at
the same part of the screen, conventionally the centre, to minimise the effect of
misconvergence. If desired, a patch near one corner can be measured in a sepa-
rate series, and the results averaged.
Provided the phosphors are not being driven into saturation, the measured
gamma value should be much the same regardless of the setting of the bright-
ness control. Although the eye can adapt to the ambient light level, a meter
cannot, so the screen and meter should be well shrouded with heavy cloth such
as a curtain, to eliminate stray light.
Remembering that the gamma function is a power law, the input RGB value and
output light level should be plotted on a log/log scale. The spacing of the test
samples should take this into account, so that samples are evenly spaced on the
log axis.
University of Manchester 83
If the data points cluster around a straight line, the slope of that line is the
gamma value. Significant deviations from a straight line can only be dealt with
by a lookup table.
The method relies on the fact that, regardless of the gamma value, white and
black are fixed points. This is shown in Figure 60; altering the gamma value only
affects the amount of curvature, not the position of the end points.
1.0
light output
0.0
0.0 1.0
input RGB
A grey colour is mixed, for example using a paint package, keeping R,G and B
equal. If the HLS colour model is available, mixing a colour with a saturation of
zero will accomplish this. Call the value of RGB which matches the chequerboard
pattern V. The gamma value is given by:
For example, if V is 0·73, the gamma is 2·2. This is shown in Figure 61.
light output
0.0
0.0 0.5 V 1.0
input RGB
University of Manchester 85
B Monitor calibration
For precise work, each monitor should be calculated by directly measuring the
tristimulus values with a spectroradiometer. To compensate for drift in electronic
components, and phosphor ageing, this calibration is performed monthly, weekly
or even (in highly critical applications such as colour pre-press soft proofing or
dyestuff quality control) daily. Monitors are available which can auto-calibrate
themselves.
Chromaticity values are generally supplied as x,y pairs. The first step is to calcu-
late the z components:
z=1–x–y
2 3
xr xg xb
A=4 yr yg yb 5
zr zg zb
B = A−1
Xw = xw /yw
Yw = 1.0
Zw = zw /yw
2 3
Xw
C = B4 Yw 5
Zw
University of Manchester 87
The elements of C are inserted into the major diagonal of a new matrix D, the
other elements being zero:
2 3
C1 0 ⋅ 0 0 ⋅ 0
D=4 0 ⋅ 0 C2 0 ⋅ 0 5
0 ⋅ 0 0 ⋅ 0 C3
E=AD
and this is inverted for conversion in the reverse direction. Any point specified in
RGB may then be converted to CIE 1931 XYZ by:
2 3 2 3
X R
4 Y 5 = E4 G 5
Z B
colour difference Another name for the two chrominance signals used in
video encoding.
University of Manchester 89
same colour into dark surrounds and the complementary
colour into light surrounds.
colour constancy An evolutionary survival tactic. The eye and brain try to
hold the perceived colour of objects constant regardless of
slow changes in the level or colour of daylight. Only
partly successful, and less so for non-daylight illumina-
tion.
colour management system A piece of software that helps achieve screen to print col-
our matching, often by displaying the gamuts of the two
devices.
density Log of one over the reflectance. White and light colours
have a low density, black and dark colours have a high
density.
dot gain Non-linear increase in the size of halftone dots. Has a va-
riety of causes, and is measured and corrected for in high
quality commercial colour printing.
University of Manchester 91
surroundings must be considered. Luminance is a way of
measuring light intensity that takes into account the
photopic luminous efficiency curve.
metamerism (1) The fact that two spectrally different samples can give
the same colour sensation, which allows the simulation of
many colours with only three primaries.
(2) A consequence of the information loss when computing
tristimulus values. Two spectrally different samples may
give the same values (and hence look identical) under one
illuminant, while giving different values (and looking dif-
ferent) under another illuminant.
perfect diffuse reflector A white target that does not modify light at all, but re-
flects 100% of it at all wavelengths.
photopic vision Light adapted vision at low to high light levels, where
rods are saturated and cones provide colour information.
scotopic vision Dark adapted vision, in very low light levels, using only
rods for monochromatic vision.
spot colour Single colour of ink, used without mixing. Many hundreds
of spot colours are available, covering a huge gamut. Gen-
erally only a few spot colours are used in a single print.
tristimulus value The amount of each of the three CIE primaries which,
when mixed, would give the same colour sensation as a
sample of a given colour.
University of Manchester 93
under colour removal Addition of black to dark colours, to boost contrast.