You are on page 1of 64

Multimedia Systems

Color Theory
Syed Naqvi, PhD
The Color Problem
Visual capture devices capture visual signals and store
them in a digital format, which is rendered on visual
display devices.
A rendered image should look the same as the color
image of the original object, irrespective of which device
captured the visual image, or which device is rendering it.
Signal reaching the capturing sensor or the eye is the result of a
complex interaction between the observed image and the
(unknown) illuminating conditions.
The Color Problem
In practice, however, people have no problem
declaring that that images rendered on different
devices look the same.
Resolving this difficulty requires a clear
understanding of the physics of color image
formation, which involves wavelength analysis,
understanding of the psychophysics of image
perception by the human visual system, and
knowledge of the way capture and display devices
work.
Color and Light
Color is both a physical element and a perceptual
sensation interpreted by our brains when light enters
the eye.
Newton showed that sunlight could be separated
into the various colors of the rainbow when passed
through a prism.
His theory on colors eventually led to the creation of
the color wheel in 1666 and later to an
understanding of the frequencies that make up light.
The Nature of Light
Light is an electromagnetic phenomenon, like
television waves, infrared radiation, and x-rays.
By light, we mean those waves that lie in a narrow
band of wavelengths in the so-called visible spectrum.
The wavelength is the distance light travels during one
cycle of its vibration.
Wavelength and frequency f are related by = v/f,
where v is the speed of light in the medium of interest.
In air (or a vacuum) v = 300,000 km/sec
The Nature of Light
The visible spectrum of white light contains all wavelengths
from 400 to 700 nanometers.
Wavelengths below 400 (known as ultraviolet) and those
above 700 (known as infrared) cannot be sensed by the
human visual system.
The distribution of energy among the visible wavelengths or
frequencies also varies, depending on illumination. For
example, daylight produces a spectral distribution that is
different from the distribution due to yellow light from a
tungsten filament, which is the material used in ordinary light
bulbs.
The Electromagnetic
Spectrum
Color Theory
Color theory is a body of practical guidance to color
mixing and the visual impact of specific color
combinations.
Color is made from three basic primaries.
Color depends on subtle interactions between the
physics of light radiation and the eye-brain system.
Primary Colors
Red, Yellow and Blue
In traditional color theory
(used in paint and pigments),
primary colors are the 3
pigment colors that can not be
mixed or formed by any
combination of other colors.
All other colors are derived
from these 3 hues.
9
Secondary Colors
Green, Orange and Purple
These are the colors
formed by mixing the
primary colors.

10
Tertiary Colors
Yellow-orange, red-orange,
red-purple, blue-purple,
blue-green & yellow-green
These are the colors formed
by mixing a primary and a
secondary color. That's why
the hue is a two word name,
such as blue-green, red-
violet, and yellow-orange.
11
The Color Wheel
A color circle, based on red, yellow and blue, is
traditional in the field of art.
Sir Isaac Newton developed the first circular diagram
of colors in 1666. Since then, scientists and artists
have studied and designed numerous variations of
this concept.
Differences of opinion about the validity of one
format over another continue to provoke debate. In
reality, any color circle or color wheel which presents
a logically arranged sequence of pure hues has merit.
12
The Color Wheel

13
Color Vision
Human eye has three different kinds of color receptors,
corresponding roughly to the red, green, and blue colors.
The three colors can generate various colors by additively
mixing.
Experiments demonstrated that most colors can be matched
by superimposing three separate lights known as primaries.
Although three primary colors were necessary, the choice of
three was not unique and, more important, that no additive
combination of three primaries can cover all the perceivable
colors.
The Human Eye
The retina of the eye contains light-sensitive
membrane. It lines the rear portion of the eye's wall
and contains two kinds of receptor cells: cones and
rods.
The cones are the color-sensitive cells, each of which
responds to a particular color, red, green, or blue.
The rods cannot distinguish colors, nor can they see
fine detail.
The Human Eye: Cones
According to the tri-stimulus theory, the color we see is the
result of our cones relative responses to red, green, and blue
light.
The human eye can distinguish about 200 intensities of red,
green, and blue, each.
An eye has 6 to 7 million cones, concentrated in a small portion
of the retina called the fovea.
Each cone has its own nerve cell, allowing the eye to discern
tiny details.
To see an object in detail, the eye looks directly at it in order to bring
the image onto the fovea.
17
The Human Eye: Rods
Seventy-five million to 150 million rods are crowded
onto the retina surrounding the fovea.
A single nerve cell has many rods attached to it,
preventing the discrimination of fine detail.
Rods are very sensitive to low levels of light and can
see things in dim light that the cones miss.
At night, for instance, it is best to look slightly away from
an object so that the image falls outside the fovea.
19
Pure Light
Some light sources, such as lasers, emit light
of essentially a single wavelength or pure
spectral light.
We perceive 400 nm light as violet and 620
nm light as red, with the other pure colors
lying in between these extremes.
Pure Light
The figure shows some example spectral densities
S() (power per unit wavelength) for pure lights and
the common names given to the colors we see.
Light Sources
The light from most sources does not consist
of only one wavelength; instead, it contains
varying amounts of power in a continuous set
of wavelengths.
Their set of spectral densities (or spectra)
covers a band of wavelengths.
The total power of the light in any band of
wavelengths is found as the area under the
density curve over that band.
Example Spectra for Common
Colors
Example Spectra
Light Sources
White light contains approximately equal
amounts of power at all frequencies, as does
gray (but at a lower intensity).
Reds tend to have more power concentrated
at the longer wavelengths, and blue at shorter
wavelengths.
Problem: an enormous variety of spectral
density functions is perceived by the eye as
having the same color.
RGB Color Blindness
Some peoples visual system cannot
distinguish red and green light.
Approximately 10% of males (but far fewer
females) are color-blind in the sense that
they cannot distinguish some colors from
others.
Tests have been devised to determine
whether a given individual suffers from this
lack of perception.
RGB Color Blindness
The companion web site illustrates such a test by
placing a large number of circles in a large circle.
(Can you see the numbers?)
The small circles are rendered with slightly different
colors, chosen so that a person with normal vision
will see numerical patterns in the large circle but a
color-blind person will see only a random pattern of
circles.
Color Description
Suppose that you want to describe a color
precisely over the telephone, where all
descriptions must be made orally.
You want to describe the color by a small set
of numbers.
How many numbers are required?
Remarkably, the answer is three numbers: human
color perception is three dimensional.
Color Description
What do the numbers mean?
One simple way to describe a color capitalises
on the variety of spectra that produce the
same (perceived) color.
Color Description
It specifies a spectrum having the shape shown in the
figure by three numbers: dominant wavelength,
saturation, and luminance.
Color Description
The spectrum consists of a spike located at a
dominant wavelength - 620 nm in the example.
The location of the dominant wavelength specifies
the hue of the color, in this case red.
In addition, a certain amount of white light is
present, represented by the rectangular pedestal that
desaturates the light from a pure red, making it
appear pink.
Color Description
The total power in the light (its luminance) is the
area L under the entire spectrum.
The rectangular shapes make the calculation simple:
L = (700 - 400)A + (D - A)B.
The saturation (or purity) of the light is defined as
the percentage of luminance that is in the dominant
component:

purity
D A B
100%
L
Color Description
If D = A, the purity is 0, and white light is observed
without any trace of red.
If A = 0, no white light is present, and a pure red light
is seen.
Pastel colors contain a large amount of white and are
said to be unsaturated.
When two colors differ only in hue, the eye can distinguish
about 128 different hues.
When two colors differ only in saturation, the eye can
distinguish about 20 different saturations, depending on
the hue.
Tristimulus Theory
The CIE Standard

A standard was devised in 1931 by the International


Commission on Illumination (Commission
Internationale de lclairage, or CIE).
The CIE defined three special supersaturated
primaries, X, Y, and Z.
They don't correspond to real colors, but they do
have the property that all real colors can be
represented as positive combinations of them.
Using the CIE Chart
When two colors are
added and their sum is
white, we say the colors
are complementary.
e (blue-green) and f
(orange-pink) are
complementary colors
because proper amounts
of them added together
form white, w.
Using the CIE Chart
Other complementary colors:
red cyan
green magenta
blue yellow
Using the CIE Chart
Color gamuts are the range of colors that a
device can produce.
The printer gamut is the cloud; the monitor
gamut is the triangle.
Printers can produce some colors monitors
cannot, and vice versa.
TERTIARY COLORS
Formed by mixing a primary and a secondary
color
Yellow-orange, red-orange, red-purple, blue-
purple, blue-green and yellow-green
Color Models
A color model is an abstract mathematical model
describing the way colors can be represented as
numbers, typically as three or four values or color
components (e.g. RGB and CMYK are color models).
Color Spaces
The CIE's specification of color is precise and
standard, but it is not necessarily the most
natural.
In computer graphics, it is most natural to think of
combining red, green, and blue to form the colors
desired.
Other people use hue, saturation, and lightness.
Artists frequently refer to tints, shades, and tones.
Color Spaces
These all are examples of color models, choices of
three descriptors used to form colors.
If one can quantify the three descriptors, one can
then describe a color by means of a 3-tuple of values
[a 3D coordinate system], such as (tint, shade,
tone)=(.125, 1.68, .045).
The different choices of coordinates then give rise to
different color spaces, and we need ways to convert
color descriptions from one color space to another.
RGB Color Space
The RGB color model describes colors as
positive combinations of three primaries: red,
green, and blue.
If the scalars r, g, and b are confined to values
between 0 and 1, all definable colors will lie in
the cube shown.
RGB Color Space
There is no normalization for the intensity of the color.
Points close to (0, 0, 0) are dark, and those farther out are
lighter.
For example, (1, 1, 1) corresponds to pure white.
This color space is the most natural for computer graphics; a
color specification can be directly translated into values stored
in a color lookup table.
The corner marked magenta properly signifies that red light
plus blue light produces magenta light, and similarly for
yellow and cyan.
Colors at diagonally opposite corners are complementary.
Additive and Subtractive
Color Systems
So far we have considered summing contributions of
colored light to form new colors, an additive process.
An additive color system expresses a color, D, as the
sum of certain amounts of primaries, usually red,
green, and blue: D=(r, g, b).
An additive system can use any three primaries, but
because red, green, and blue are situated far apart in
the CIE chart, they provide a large gamut.
Additive and Subtractive
Color Systems
Subtractive color systems are used when it is natural
to think in terms of removing colors.
When light is reflected (diffusely) from a surface or is
transmitted through a partially transparent medium
(as when photographic filters are used), certain
colors are absorbed by the material and thus
removed.
This is a subtractive process.
Additive and Subtractive
Color Systems
A subtractive color system expresses a color,
D, by means of a 3-tuple, but each of the
three values specifies how much of a certain
color (the complement of the corresponding
primary) to remove from white in order to
produce D.
The most common subtractive system, the
CMY system, uses the subtractive primaries
cyan, magenta, and yellow.
Additive and Subtractive
Color Systems
If we say that D=(c, m, y)CMY, we are saying that
D is formed from white by subtracting amount
c of the complement of cyan (red), amount m
of the complement of magenta (green), and
amount y of the complement of yellow (blue).
Thus (R, G, B) = (1, 1, 1) (c, m, y)CMY
Additive and Subtractive
Color Systems
The three glass slides are described by (.4, .5, .2)CMY.
Additive and Subtractive
Color Systems
When white light, (1, 1, 1)RGB, penetrates the cyan-
colored slide, 40% of the red component is absorbed,
and a light containing (.6, 1, 1)RGB emerges.
When this light penetrates the magenta slide, 50% of
the green light is removed, and the color (.6, .5, 1)RGB
emerges.
Finally, this light penetrates the yellow slide, 20% of
the blue component is absorbed, and the color (.6, .
5, .8)RGB emerges.
Additive and Subtractive
Color Systems
A similar description applies to light scattering
from a colored surface.
In a three-color printing process, cyan, magenta,
and yellow pigments are suspended in a colorless
paint. Each subtracts a portion of the complement
component of its incident light.
The subtractive system is used for color hard-copy
devices to form colors by mixing the three CMY
primaries.
Additive and Subtractive
Primaries
HLS Color Space
A more intuitive color model uses coordinates
hue (H), lightness (L), and saturation (S) to
describe colors because these are qualities
that the human eye easily recognizes and can
distinguish.
HLS Color Space
The model arises from a distortion of the RGB
cube into a double cone.
HLS Color Space
Hue can be associated with an angle between 0 and
360 degrees. Convention puts 0 degrees at red.
Lightness varies from 0 when all the RGB
components are 0 to 1 when they all are 1. It is the
vertical axis of the double cone.
Saturation, which is roughly the distance a color lies
away from the diagonal of the RGB cube, is mapped
into radial distance from the lightness axis of the HLS
cones.
Indexed Color and the
LUT
Some systems use a color lookup table (or
LUT), which offers a programmable
association between pixel value and final
color.
Indexed Color and the LUT
LUT
63

framebuffer:
6bitplanes index 39 010101100110010
toLUT

39

2
1
0

5 5 5
Indexed Color and the LUT
In the figure, the color depth is six, but the six bits
stored in each pixel are used as an index into a table
of 64 values, say LUT[0]...LUT[63].
For instance, if a pixel value is 39, the values stored in
LUT[39] are used to drive the DACs, as opposed to
having the bits in the value 39 itself drive them.
In the figure, LUT[39] contains the 15 bit value 01010
11001 10010. Five of these bits (01010) are routed to
drive the red DAC, five others drive the green
DAC, and the last five drive the blue DAC.
Indexed Color and the
LUT
Each of the LUT[ ] entries can be set under program
control.
To make a particular pixel this color, say the pixel at
location (x, y) = (479, 532), the value 39 is stored in
the frame buffer.
Each time the frame buffer is scanned out to the
display, this pixel is read as value 39, which causes
the value stored in LUT[39] to be sent to the DACs.
This programmability offers a great deal of flexibility
in choosing colors, but of course the program has to
figure out which colors to use.
Indexed Color and the
LUT
How many colors are available?
Each entry of the LUT consists of 15 bits, so
each color can be set to one of 215 = 32K =
32,768 possible colors. The set of 215 possible
colors displayable by the system is called its
palette, so we say this display has a palette of
32K colors.
However, only 64 colors are available at any
one time.
Indexed Color and the LUT
At one time means during one scan-out of the
entire frame buffer something like 1/60-th of a
second.
Usually the LUT contents remain fixed for many scan-
outs, although a program can change the contents of
a small LUT during the brief period between two
successive scan-outs.
More generally, if a raster display system has a color
depth of b bits (so there are b bit planes in its frame
buffer), and if each LUT entry is w bits wide, then the
system can display 2w colors, any 2b at one time.
Indexed Color and the
LUT
There is no enforced relationship between the
number of bit planes, b, and the width of the
LUT, w.
Normally w is a multiple of 3, so the same
number of bits (w/3) drives each of the three
DACs.
Also, b never exceeds w, so the palette is at
least as large as the number of colors that can
be displayed at one time.
Indexed Color and the
LUT
Note that the LUT itself requires very little memory,
only 2b words of w bits each. For example, if b = 12
and w = 18, there are only 9,216 bytes of storage in
the LUT.
So the motivation for using a LUT in a raster display
system is usually a need to reduce the cost of
memory.
Increasing b increases significantly the amount of memory
needed for the frame buffer, mainly because there are so
many pixels. The tremendous amount of memory needed
can add significantly to the cost of the overall system.
The Nature of Light
The visible spectrum of white light contains all
wavelengths from 400 to 700 nanometers.
Wavelengths below 400 (known as ultraviolet) and
those above 700 (known as
infrared) cannot be sensed by the human visual
system, and, hence, do not contribute
to color perception. Furthermore, the distribution of
energy among the visible wavelengths
or frequencies also varies, depending on illumination.
For example, daylight
produces a spectral distribution that is different from

You might also like