Title: Achromatic light
1Color in Computer Graphics
- Introduction
- Achromatic light
- Chromatic color
- Color models for raster graphics
- Reproducing color
- Using color in computer graphics
2Introduction
Color is an immensely complex subject
- Physics
- Physiology
- Psychology
- Art
- Graphic design
Many theories, measurement techniques, and
standards for colors. No one theory of human
color perception universally accepted.
3Introduction
- Color of object depends not only on object
itself - Light source (color / direction)
- Object material (reflective, transmits light)
- Color of surrounding area
- Human visual system (the eye/brain mechanism)
4Achromatic Light
- Seen on black and white TV or display monitors
- No sensations that we associate with colors.
- Quantity of light is the only attribute.
- Quantity of light
- Intensity / luminance Physics
- Brightness Psychology
Useful to associate a scalar quantity with
different intensity levels Black
Grays White 0-------------------
-----------------------------------------1
5Selecting Intensities
- How do we divide our range from 0 to 1 to be able
to - represent 256 intensity levels ?
- 128 in 0, 0.1 and 128 in 0.9, 10
- Visible gap from 0.1 to 0.9
- Want predictability
- Even distribution ?
- Ignores important characteristic of human eye.
- Eye is sensitive to ratios of intensity levels
rather - then absolute values of intensity.
- Perceive difference between 0.10 and 0.11 to be
- the same as difference between 0.50 and 0.55
- Studies have shown that the eye responds in a
logarithmic way.
6Selecting Intensities
- Logarithmic distribution Each intensity level is
r times higher than previous intensity level
I0 I0 I1 rI0 I2 rI1 r2I0 ... I255
r255I0 1
(In general for n levels r (1/I0)1/n-1)
r (1/I0)1/255
The quantity 1/I0 is called the Dynamic range of
a device i.e. ratio of maximum to minimum
intensities.
- Use r to find any intensity value j for 0, 255
- Ij rjI0
7Selecting Intensities
n 4 I0 1/8
gt r (1/I0)1/n-1) 2
gt Intensity values are 1/8, 1/4, 1/2, 1
- Typical CRT I0 anywhere from 1/200 to 1/40 of
maximum intensity gt I0 between .005 and .025 - I0 not zero because of light reflection off CRT
phosphors. - Exact value for a specific CRT can be measured
with a photometer.
8Displaying Intensities
- How many intensities are enough to achieve a
continuous tone image from black to white ? - Experiments have shown r 1.01or less. Below
this ratio the human eye cannot distinguish
between Ij and Ij1. - Solve for n
n log1.01(1/I0)
The quantity 1/I0 is called the Dynamic range of
a device i.e. ratio of maximum to minimum
intensities.
9Display Media
- Dynamic range (1/I0) and theoretical number of
required - intensities n log 1.01(1/I0) for several
display media (ink - bleeding, random noise considerably decreases n
in - practice)
10Displaying Intensities
- CRT Monitors
- 3 guns firing electrons at slightly different
angles to illuminate phosphors coating the inside
of the tube. - The guns follow the signals it receives from
the graphics controller. - The phosphors light up when hit with electrons,
mixing red, green, and blue to create the colors
you see on the screen. - The point where one set of adjacent red, green,
and blue phosphors meet constitutes a pixel
(short for "picture element"), - Because the phosphors that make up a pixel light
up only briefly, they need to be constantly
refreshed, so the beam continually seeps the
inside of the tube.
11Displaying Intensities
- Intensity of light output by a phosphor is given
by - I kN
- N number of electrons in beam, proportional to
grid voltage. - k, are constants
- Different phosphors respond differently to equal
amounts of electrons. - I0, k and depend on the CRT being used. So
different - CRTs will display differently.
- In practice a lookup table can be used (based on
actual - measurement of intensities) to generate the same
intensities - on different monitors. Called Gamma Correction
is typically in the range of 2.2 to 2.5
12Displaying Intensities
- Gamma (?) is a measure of the non-linearities of
a CRT - Term often used incorrectly to refer to
non-linearity of image data - Example PC monitors have a gamma of roughly 1.8,
while Mac monitors have a gamma of 2.2, so Mac
images appear dark on PCs - Problem in graphics
- Need to maintain color consistency across
different platforms and hardware devices
(monitor, printer, etc) - Even the same type/brand of monitors change gamma
value over time - Proper design and use of color software
13Chromatic Color
- Visual sensations much richer than achromatic
light. - Typically involve 3 quantities
- Hue distinguishes among colors such as red,
green, purple, and yellow - Saturation refers to how pure the color is, how
far from gray of equal intensity - Red Is highly saturated pink is relatively
unsaturated - Royal blue is highly saturated sky blue is
relatively unsaturated - Pastels are unsaturated
- Lightness embodies the achromatic notion of
perceived intensity of a reflecting object - Brightness is used instead of lightness to refer
to the perceived intensity of a self-luminous
(I.e., emitting rather than reflecting light)
object, such as a light bulb, the sun, or a CRT
14Specifying (Naming) Color
- Specifying and measuring colors is necessary if
we are to use them precisely in computer
graphics - Visually comparing a sample of unknown color
against a sample of standard colors (reflected
light). Must be done under standard light source. - Munsell color-order system (published standard
colors) - Hue, Value (lightness), Chroma (saturation)
- Named colors
- Order shows equal (perceived) distance in color
space as judged by numerous observers. - PANTONE Matching System in printing industry
15The Munsell System
Munsell Value
Munsell Chroma (saturation)
Munsell Hue
Munsell Color Space
16Specifying (Naming) Color
- Artists specify color as tint, shade, tone of
strongly saturated or pure pigments. - A tint results from adding a white pigment to a
pure pigmentdecreasing saturation - A shade results from adding a black pigment to a
pure pigmentdecreasing lightness - A tone results from adding both white and black
pigments to a pure pigment - NOTE Same hue, varying saturation and lightness.
- Ostwald color-order system is based on this model
17Psychophysics
- Comparison of tint, shade, and tone are
subjective, perceptually-oriented concepts
depend on observers judgment, lighting, sample
size, surrounding color, overall lightness of
environment - Need a more quantitative way to specify colors
- Colorimetry is quantitative, physics-oriented
approach to describing and measuring color (using
spectroradiometer, colorimeter, etc.)
18Psychophysics
19Psychophysics
Energy Density
Typical spectral energy distribution
Perceptual term
Colorimetry term Hue Dominant
wavelength Saturation Excitation
purity Lightness (reflecting objects)
Luminance Brightness (self-luminous objects)
Luminance
20Energy Distribution and Metamers
- The spectral distribution can be described by the
triple (dominant wavelength, excitation purity,
luminance) - Many spectral distributions produce the same
color - Two spectral energy distributions that are
perceived as the same color are called metamers
21How the eye works
- Retina light sensing structure of the eye.
- Contains 2 types of cells
- Rods
- Cones
- Rods handle vision in low light
- Cones handle color vision and detail.
- When light contacts these two types of cells, a
series of complex chemical reactions occurs. - These reactions generate electrical impulses in
the optic nerve which sends it to the brain. - The retina contains 100 million rods and 7
million cones.
22How the eye works
- Eye contains three kinds of color-sensitive
pigments - Red-sensitive pigment
- Green-sensitive pigment
- Blue-sensitive pigment
- Each cone cell has one of these pigments so that
it is sensitive to that color. The human eye can
sense almost any gradation of color when red,
green and blue are mixed. (Called the
Tristimulus Theory)
Spectral response functions of 3 types of cones
in human retina.
23Color Matching
- Tristimulus theory leads to notion of matching
all visible colors with combinations of red,
green, and blue mono-spectral primaries it
almost works - Negative value gt cannot match, must subtract,
Note that mixing positive amounts of R, G, B
primaries provides large color gamut, e.g., CRT.
But CRT cant show all colors!
24CIE Chromaticity Diagram
- Commission Internationale de lÉclairage (CIE)
- Defined X, Y, and Z primaries to replace red,
green and blue primaries - x? y?, and z?, color-matching functions (not
spectral distributions) for these primaries -
25XYZ Space Showing an RGB
Gamut
- The color gamut for a typical color monitor with
the XYZ color - space. The range of colors which can be
displayed on the monitor - is clearly smaller than all colors visible in
XYZ space.
All colors
Displayable colors
26CIE Space
- Several views of the X Y Z 1 plane of CIE
space. Left the - plane embedded in CIE space. Top right a view
perpendicular to - the plane. Bottom right the projection onto
the (X, Y) plane (that - is, the Z 0 plane), which is the chromaticity
diagram
27CIE Chromaticity Diagram
- CIE chromaticity diagram is the projection onto
the xy plane of the x y z 1 plane - Luminance is factored out
- All perceivable colors with same chromacity but
different luminances map into same point - 100 spectrally pure colors are on curved part
28CIE Chromaticity Diagram
- Uses of CIE Chromaticity diagram
- Allows us to measure dominant wavelength and
excitation purity of any color by matching the
color with a mixture of the 3 CIE primaries - Define color mixing
- Define and compare color gamuts
- Gamut is set of colors visible via particular
medium
29CIE Chromaticity Diagram
- When two colors added, new color lies on straight
line connecting two colors A tC (1 t)B - Ratio AC/BC is excitation purity of A
- Complementary colors can be mixed to produce
white light (a decidedly non-spectral color!)
white can thus be produced by an approximately
constant spectral distribution as well as by only
two complimentary spectral colors, e.g., D and E
Matched color at A
30Color Gamuts
- Any two colors, I and J, can be added to produce
any color along their connecting line by varying
relative amounts of two colors - Third color K can be used with various mixes of I
and J to produce a gamut of all colors in
triangle IJK, again by varying relative amounts - Shape of diagram shows why visible red, green and
blue cannot be additively mixed to match all
colors no triangle whose vertices are within the
visible area can completely cover visible area
(e.g., purple and magenta) - Matching of all visible colors requires negative
amounts of primaries for some
31Color Gamuts
- Smallness of print gamut with respect to color
monitor gamut faithful reproduction by
printing must use reduced gamut of colors on
monitor
32Color Models for Raster Graphics
(1/2)
- Purpose specify colors in some gamut
- Since gamut is a subset of all visible
chromaticities, model does not contain all
visible colors - 3D color coordinate system subset containing all
colors within a gamut - Means to convert to other model(s)
33Color Models for Raster Graphics
(2/2)
- Hardware-oriented models not intuitive do not
relate to concepts of hue, saturation, brightness - RGB, used with color CRT monitors\
- YIQ, the broadcast TV color system
- CMY (cyan, magenta, yellow) for color printing
- CMYK (cyan, magenta, yellow, black) for color
printing - User-oriented models
- HSV (hue, saturation, value) also called HSB
(hue, saturation, brightness) - HLS (hue, whiteness, blackness)
- The Munsell system
- CIE LUV
- HVC (Tektronix proprietary)
34The RGB Color Model (1/3)
- RGB primaries are additive
- The RGB cube. (Grays are on the dotted main
diagonal) - Main diagonal gray levels black is (0, 0,
0) white is (1, 1, 1) - RGB color gamut defined by CRT phosphor
chromaticities - Differs form one CRT to another
35The RGB Color Model (2/3)
- Conversion from one RGB gamut to another
- Convert one to XYZ, then convert from XYZ to
another - Form of each transformation
- Where xr, xg, and xb are the weights applied to
the monitors RGB colors to find x, and so on - M is the 3 x 3 matrix of color-matching
coefficients - Let M1 and M2 be matrices to convert from each of
the two monitors gamuts to CIE - M2-1 M1 converts form RGB of monitor 1 to RGB of
monitor 2
36The RGB Color Model (3/3)
- But what if
- C1 is in the gamut of monitor 1 but is not in the
gamut of monitor 2, I.e., is outside the unit
cube and hence is not displayable? - Solution 1 clamp RGB at 0 and 1
- Simple, but distorts color relations
- Solution 2 compress gamut on monitor 1 by
scaling all colors from monitor 1 toward center
of gamut 1 - Ensure that all displayed colors on monitor 1 map
onto monitor 2
37The CMY(K) Color Model (1/2)
- Cyan, magenta, and yellow are complements of red,
green , and blue - Subtractive primaries colors are specified by
what is removed or subtracted from white light,
rather than by what is added to blackness - Cartesian coordinate system
- Subset is unit cube
- White is at origin, black at (1, 1, 1)
- Mixing Subtractive primaries (C,M,Y)
38The CMY(K) Color Model (2/2)
- Color printing presses, some color printers use
CMYK (Kblack) - K used instead of equal amounts of CMY
- Called undercolor removal
- Richer black
- Less ink deposited on paper dries more quickly
39The YIQ Color Model
- Recoding for RGB for transmission efficiency and
downward compatibility with B/W broadcast TV
used for NTSC (National Television Standards
Committee (or never the same color)) - Y is luminance same as CIE Y primary
- I and Q encode chromaticity
- First row relative importance of RGB in
brightness (Note low B) - YIQ exploits properties of our visual system to
maximize information transmitted - More sensitive to changes in luminance than
changes to hue or saturation. gt More bits to
represent Y then I or Q - 4 MHz for the Y channel
- 1.5 MHz for I (small images need only 1 color
dimension - 0.6 MHz for the Q channel
40The HSV Color Model (1/2)
- Hue, saturation, value (Hue, saturation,
brightness) - Hexcone subset of cylindrical (polar) coordinate
system - Single hexcone HSV color model. (The V 1
plane contains the RGB models R 1, G 1, B
1, in the regions shown) - Has intuitive appeal of the artists tint, shade,
and tone model
41The HSV Color Model (2/2)
- Colors on V 1 plane are not equally bright
- Complementary colors 180 opposite
- Saturation measured relative to color gamut
represented by model which is subset of
chromaticity diagram - Therefore, 100 S 100 excitation purity
- Top of HSV hexcone is projection seen by looking
along principal diagonal of RGB color - RGB color cube viewed along the principal
diagonal - Code for RGB HSV on Page 592, 593
- Note linear path RGB lt gt linear path in HSV!
42The HLS color Model
- Hue, lightness, saturation
- Double-hexcone subset
- Maximally saturated hues are at S 1, L 0.5
- Less attractive for sliders or dials
- Neither V nor L correspond to Y in YIQ!
43Problems with Standard Color
Systems
- They are perceptually non-uniform
- Move through color space from color C1 to a new
color C1? through a distance ?C
C1? C1 ?C - Move through the same distance ?C, starting from
a different color C2
C2? C2 ?C - The change in color in both cases is
mathematically equal, but is not perceived as
equal - Moving a slider almost always causes a perceptual
change in the other two values, which is not
reflected by changes in those sliders. Thus,
changing hue frequently will affect saturation
and value - Ideally want a perceptually uniform space
two colors that are equally distant
are perceived as equally distant, and changing
one value does not perceptually alter the other
two - Historically, the first perceptually-uniform
color space was the Munsell system
44CIE LUV
- 1976 CIE LUV provides a compromise between a
mathematically described space and a perceptually
uniform color space - Much more perceptually uniform than the 1931 CIE
system - Still described mathematically
- Given white (Xn, Yn, Zn)
- These transformations cause regions of colors
perceived as identical to be of the same size
45Tektronix HVC
- Hue, value, chroma
- Modification of CIE LUV perceptually uniform
color space - Color space details are proprietary, but CIE LUV
is computationally simple
46Color Model Pros and Cons (1/2)
- RGB
- Cartesian coordinate system
- linear
- hardware-based (easy to transform to video)
- tristimulus-based
- - hard to use to pick and name colors
- - doesnt cover gamut of perceivable colors
- - non-uniform equal geometric distance gt
unequal - perceptual distance
- CIE
- covers gamut of perceived colors
- based on human perception (matching
experiments) - linear
- contains all other spaces
- - non-uniform (but two new variations, CIE Lab
and CIE - LUV, are closer to Munsell, which is
uniform) - - xy-plot of chromaticity horseshoe diagram
doesnt show - luminance
47Color Model Pros and Cons (2/2)
- HSV
- easy to convert to RGB
- easy to specify colors (artists Model)
-
- - non-linear
- - doesnt cover gamut of perceivable colors
- - non-uniform
48Interactive Specification of Color
(1/2)
- English-language names
- Ambiguous and subjective
- Numeric coordinates in color space with slide
dials - Two types of sliders for setting color
- - Good if user understands how each dimension
affects color
49Interactive Specification of Color
(2/2)
- Interact with visual representation of the color
space - A convenient way to specify colors in HSV space
- Important for user to see actual display with new
color - Beware of surround effect!
50The gray patches on the blue and yellow
backgrounds are physically identical. But they
dont look that way to begin with, there is a
difference in perceived brightness the patch on
the blue looks brighter than the one on the
yellow, a result of brightness contrast. There
is also a difference in perceived hue, for the
patch on the blue looks somewhat yellowish, while
that on the yellow looks bluish. This is color
contrast, a demonstration that hues tend to
induce their antagonists in neighboring areas.
51Interpolating in Color Space (1/2)
- Interpolation needed for
- Gouraud shading
- Antialiasing
- Blending images together in a fade-in, fade-out
sequence - Results depend on the color model used
- RGB, CMY, YIQ, CIE are related by affine
transformations, hence straight line (I.e.,
interpolation paths) are maintained during
mapping - Not so for HSV, HLS, HVC.
52Interpolating in Color Space (2/2)
- For Gouraud shading, use any of the models
because interpolants generally so close together
that interpolation paths are close together - For blending two images, as in fade-in fade-out
sequence or for antialiasing, colors may be quite
distant - Use additive model, such as RGB
- If interpolating between two colors of fixed hue
(or saturation), maintain fixed hue (saturation)
for all interpolated colors by HSV or HLS - Note fixed-saturation interpolation in HSV or HLS
is not seen as having exactly fixed saturation by
viewer!
53Using Color in Computer
Graphics
- Aesthetic uses
- Establish a tone or mood
- Promote realism
- Highlight
- Code numeric quantities
- Temperature across the U.S.
- People use color even in cases when there is no
quantitative evidence that it improves
understanding in what they are trying to
communicate - Based on likes and dislikes
54Using Color in Computer
Graphics Functionality
- Careless use of color perilous
- Decorative use of color subservient to functional
use - Test with real users
- Provide best judgment defaults
- Allow user to override defaults
- Design first for a monochrome display (color use
is redundant in monochrome displays and for
color-blind users) - Conservative is better !
55Using Color in Computer
Graphics Approach
- Color harmony
- Select colors according to some method, typically
by traversing a smooth path in a color model - Restrict colors to planes or hexcones in a color
space - Space colors at equal perceptual distances
- Light-dark contrast more important than hue
contrast - Specifics
- If a chart contains just a few colors, the
complement of one of the colors should be used as
the background - Use neutral (gray) background for an image with
many colors - Separate non-harmonious colors by thin black
border - Coding
- Use small number of colors
- Show reference scale
- Color can carry unintended meanings
- Bright, saturated colors stand out (may give
unintended emphasis) - Display elements of same color may incorrectly be
associated by user
56Using Color in Computer Graphics
Physiological Rules (1/2)
- Eye is more sensitive to spatial variation
- Fine detail should vary from the background not
just in chromaticity, but in brightness - For color-blind users, avoid reds and greens with
low saturation and luminance - Color of small objects less than 20-40 minutes of
arc are not distinguishable
Blue
Yellow
57Using Color in Computer Graphics
Physiological Rules (2/2)
- Difficult to perceive color when used with small
objects dont use color coding for them - Perceived color of object is affected by color of
surrounding area - Strongly saturated colors produce after images
- Color affects perceived size
- Red seen as larger than green
- Colors refract differently through our lens
appear at different depths - Red (closer) vs blue (farther) strongest effect
- Apply color conservatively, not gratuitously --
color-it-is as bad as font-it-is
58Negative Afterimage
- Stare at the center of the figure for about a
minute or two, and then look at a blank white
screen or a white piece of paper - Blink once or twice the negative afterimage will
appear within a few seconds showing the rose in
its correct colors (red petals and green
leaves)