0% found this document useful (0 votes)
48 views

CS 445 / 645 Introduction To Computer Graphics: Color

The document discusses color perception and color representations in computer graphics. It covers topics like color perception in human vision, color spaces like RGB and CMYK, halftoning techniques for printing color images, and the HSV color space model. The HSV model represents color as a combination of hue, saturation, and value, corresponding intuitively to concepts of tint, shade, and tone used by artists.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

CS 445 / 645 Introduction To Computer Graphics: Color

The document discusses color perception and color representations in computer graphics. It covers topics like color perception in human vision, color spaces like RGB and CMYK, halftoning techniques for printing color images, and the HSV color space model. The HSV model represents color as a combination of hue, saturation, and value, corresponding intuitively to concepts of tint, shade, and tone used by artists.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 37

CS 445 / 645

Introduction to Computer Graphics


Lecture 13
Color
Assignment 3
Due March 23
•• Fourth
Fourth years
years plan
plan for
for thesis
thesis collision
collision
•• We’ll
We’ll provide
provide lots
lots of
of details
details to
to keep
keep the
the assignment
assignment doable
doable

Morphing algorithm
Last Class
We discussed vision physiology and
perception of gradients

Today:
Color perception
Color representations
Halftoning

A
A technique
technique used
used in
in newspaper
newspaper printing
printing
Only
Only two
two intensities
intensities are
are possible,
possible, blob
blob of
of ink
ink and
and no
no
blob
blob of
of ink
ink

But,
But, the
the size
size of
of the
the blob
blob can
can be
be varied
varied
Also,
Also, the
the dither
dither patterns
patterns of
of small
small dots
dots can
can be
be used
used
Halftoning
Halftoning – dot size
Halftoning – Moire Patterns
Repeated
Repeated use
use of
of same
same dot
dot
pattern
pattern for
for particular
particular
shade
shade results
results in
in
repeated
repeated pattern
pattern
•• Perceived
Perceived as
as aa moire
moire pattern
pattern
•• Instead,
Instead, randomize
randomize halftone
halftone
pattern
pattern
Dithering
Halftoning
Halftoning for
for color
color images
images
Specifying Color
Color
Color perception
perception usually
usually involves
involves three
three quantities:
quantities:
•• Hue:
Hue: Distinguishes
Distinguishes between
between colors
colors like
like red,
red, green,
green, blue,
blue, etc
etc
•• Saturation:
Saturation: How
How far
far the
the color
color is
is from
from aa gray
gray of
of equal
equal intensity
intensity
•• Lightness:
Lightness: The
The perceived
perceived intensity
intensity of
of aa reflecting
reflecting object
object

Sometimes
Sometimes lightness
lightness is
is called
called brightness
brightness if
if the
the object
object is
is
emitting
emitting light
light instead
instead of
of reflecting
reflecting it.
it.
In
In order
order to
to use
use color
color precisely
precisely in
in computer
computer graphics,
graphics, we
we
need
need to
to be
be able
able to
to specify
specify and
and measure
measure colors.
colors.
Combining Colors

Additive (RGB) Subtractive (CMYK)


Shining colored lights Mixing paint colors and
on a white ball illuminating with white light
How Do Artists Do It?
Artists
Artists often
often specify
specify color
color as
as tints,
tints, shades,
shades, and
and tones
tones
of
of saturated
saturated (pure)
(pure) pigments
pigments
•• Tint:
Tint: Gotten
Gotten by by adding
adding white
white to
to aa pure
pure pigment,
pigment,
decreasing
decreasing saturation
saturation
•• Shade:
Shade: Gotten
Gotten by by adding
adding
black
black to
to aa pure
pure pigment,
pigment, White
Tin
decreasing
decreasing lightness
lightness ts
•• Tone: Grays Tones Pure Color
Tone: Gotten
Gotten by by adding
adding
white
white and
and black
black toto aa pure
pure de s
Sha
pigment
pigment Black
HSV Color Space
Computer scientists frequently use an intuitive
color space that corresponds to tint, shade, and
tone:
•• Hue
Hue -- The
The color
color we
we see
see (red,
(red, green,
green, purple)
purple)
•• Saturation
Saturation -- How
How far
far is
is the
the color
color from
from gray
gray (pink
(pink is
is less
less
saturated
saturated than
than red,
red, sky
sky blue
blue is
is less
less saturated
saturated than
than royal
royal blue)
blue)
•• Brightness
Brightness (Luminance)
(Luminance) -- HowHow bright
bright is
is the
the color
color (how
(how bright
bright
are
are the
the lights
lights illuminating
illuminating the
the object?)
object?)
HSV Color Model
Hue (H) is the angle
around the vertical axis
Saturation (S) is a value
from 0 to 1 indicating
how far from the vertical
axis the color lies
Value (V) is the height of
the hexcone”
HSV Color Model
H S V Color
0 1.0 1.0 Red
120 1.0 1.0 Green
240 1.0 1.0 Blue
* 0.0 1.0 White
* 0.0 0.5 Gray
* * 0.0 Black
60 1.0 1.0 ?
270 0.5 1.0 ?
270 0.0 0.7 ?

Figure 15.16&15.17 from H&B


Intuitive Color Spaces
A top-down view of hexcone
HSV Color Space
A more intuitive color space Saturation
•• H Value
H == Hue
Hue
•• S
S == Saturation
Saturation
•• V
V == Value
Value (or
(or brightness)
brightness)
Hue
Precise Color Specifications
•• Pigment-mixing
Pigment-mixing is
is subjective
subjective ---
--- depends
depends on
on human
human observer,
observer,
surrounding
surrounding colors,
colors, lighting
lighting of
of the
the environment,
environment, etc
etc
•• We
We need
need an
an objective
objective color
color specification
specification
•• Light
Light is
is electromagnetic
electromagnetic energy
energy in
in the
the 400
400 to
to 700
700 nm
nm wavelength
wavelength
range
range
•• Dominant
Dominant wavelength
wavelength is
is the
the wavelength
wavelength of
of the
the color
color we
we “see”
“see”
•• Excitation
Excitation purity
purity is
is the
the proportion
proportion of
of pure
pure colored
colored light
light to
to white
white light
light
•• Luminance
Luminance is
is the
the amount
amount (or
(or intensity)
intensity) of
of the
the light
light
Electromagnetic Spectrum
Visible light frequencies range between ...
•• Red
Red == 4.3
4.3 xx 10 14 hertz (700nm)
1014 hertz (700nm)
•• Violet
Violet == 7.5
7.5 xx 10 14 hertz (400nm)
1014 hertz (400nm)

Figures 15.1 from H&B


Visible Light
Hue
Hue == dominant
dominant frequency
frequency (highest
(highest peak)
peak)
Saturation
Saturation == excitation
excitation purity
purity (ratio
(ratio of
of highest
highest to
to rest)
rest)
Lightness
Lightness == luminance
luminance (area
(area under
under curve)
curve)

White Light
Figures 15.3-4 from H&B Orange Light
How well do we see color?
What
What color
color do
do we
we see
see the
the best?
best?
•• Yellow-green
Yellow-green at
at 550
550 nm
nm
What
What color
color do
do we
we see
see the
the worst?
worst?
•• Blue
Blue at
at 440
440 nm
nm
Flashback:
Flashback: Colortables
Colortables (colormaps)
(colormaps) for
for color
color storage
storage
•• Which
Which RGB
RGB value
value gets
gets the
the most
most bits?
bits?
Can
Can perceive
perceive color
color differences
differences of
of 10
10 nm
nm at
at extremes
extremes (violet
(violet and
and red)
red)
and
and 22 nm
nm between
between blue
blue and
and yellow
yellow
Metamers
Metamers –– different
different energy
energy radiations
radiations look
look like
like the
the same
same color
color
Color
Color perception
perception also
also affected
affected by
by surrounding
surrounding light
light and
and adaptation
adaptation
Just noticeable difference (JND)
128 fully saturated hues can be distinguished
Cannot perceive hue differences with less
saturated light.
Sensitivity to changes in saturation for a fixed hue
and brightness ranges from 16 to 23 depending
on hue.
Talked about representing intensities last lecture
Human Color Vision
Humans
Humans have
have 33 light
light sensitive
sensitive pigments
pigments in
in their
their cones,
cones,
called
called L,
L, M,
M, and
and SS
Each
Each has
has aa different
different
spectral
spectral response
response curve:
curve:
L  L (  )E (  )d 
M   M (  ) E(  ) d 
S   S(  )E (  )d 

This
This leads
leads to
to metamerism
metamerism
“Tristimulus”
“Tristimulus” color
color theory
theory
Color Spaces
Three
Three types
types of
of cones
cones suggests
suggests color
color is
is aa 3D
3D quantity.
quantity. How
How
to
to define
define 3D
3D color
color space?
space?
Idea:
Idea:
•• Shine
Shine given
given wavelength
wavelength ()
() on
on aa screen
screen
•• User
User must
must control
control three
three lasers
lasers producing
producing three
three wavelengths
wavelengths (say
(say
R=700nm,
R=700nm, G=546nm,
G=546nm, and and B=436nm)
B=436nm)
•• Adjust
Adjust intensity
intensity of
of RGB
RGB until
until colors
colors are
are identical
identical
•• Note
Note phosphors
phosphors of of TV
TV are
are not
not perfect
perfect RGB
RGB
emitters
emitters as
as the
the results
results to
to right
right demonstrate
demonstrate
A Problem Exists
Exact
Exact target match ((ll)) with
target match with phosphors
phosphors not
not possible
possible
•• Some
Some red
red had
had to
to be
be added
added toto target
target color
color to
to permit
permit exact
exact match
match using
using
“knobs”
“knobs” on
on RGB
RGB intensity
intensity output
output ofof CRT
CRT
•• Equivalently
Equivalently (theoretically),
(theoretically),
some
some red
red could
could have
have been
been
removed
removed from
from CRT
CRT output
output
•• Figure
Figure shows
shows that
that red
red
phosphor
phosphor must
must remove
remove some
some
cyan
cyan for
for perfect
perfect match
match
•• CRT
CRT phosphors
phosphors cannot
cannot
remove
remove cyan,
cyan, so
so 500
500 nm
nm
cannot
cannot be
be generated
generated
CIE Color Space
No
No standard
standard set
set of
of three
three wavelengths
wavelengths can
can be
be
combined
combined to
to generate
generate all
all other
other wavelengths.
wavelengths.
The
The CIE
CIE (Commission
(Commission Internationale
Internationale d’Eclairage)
d’Eclairage)
defined
defined three
three hypothetical
hypothetical lights
lights X,
X, Y,
Y, and
and Z
Z with
with
these
these spectra:
spectra:
Idea:
Idea: any wavelength  can
any wavelength can
be
be matched
matched perceptually
perceptually x~R
y~G
by
by positive
positive combinations
combinations z~B
of
of X,
X, Y,
Y, and
and Z
Z
CIE Color Space
The
The gamut
gamut of of all
all colors
colors perceivable
perceivable is
is thus
thus aa three-
three-
dimensional
dimensional shape
shape inin X,
X, Y,
Y, ZZ
Color
Color == xX
xX ++ yY
yY ++ zZ
zZ
CIE Chromaticity Diagram (1931)

For simplicity, we often


project to the 2D plane
x+y+z=1
x = x / (x+y+z)
y = y / (x+y+z)
z=1–x-y
Device Color Gamuts
Since X, Y, and Z are hypothetical light sources,
no real device can produce the entire gamut of
perceivable color
Example: CRT monitor
Device Color Gamuts

We can use the CIE chromaticity diagram to


compare the gamuts of various devices:
Note, for example,
that a color printer
cannot reproduce
all shades available
on a color monitor
A Problem With XYZ Colors
If we have two colors C1 and C2, and we add DC
to both of them, the differences between the
original and new colors will not be perceived to
be equal
This is due to the variation of the just noticeable
differences in saturated hues
XYZ space is not perceptually uniform
LUV space was created to address this problem
RGB Color Space (Color Cube)
Define colors with (r, g, b) amounts of red, green,
and blue
RGB Color Gamuts
The RGB color cube sits within CIE color space
something like this:
Converting Color Spaces
Simple matrix operation:

 R '  X R XG XB   R 
 G '   Y R YG Y B   G 
  
 B '   Z R ZG Z B   B 

The transformation C22 = M-1-122 M11 C11 yields RGB on


monitor 2 that is equivalent to a given RGB on
monitor 1
YIQ Color Space
YIQ is the color model used for color TV in
America. Y is brightness, I (orange-cyan) &
Q (green-magenta) are color
•• Note:
Note: Y
Y is
is the
the same
same as as CIE’s
CIE’s YY
•• Result:
Result: Use
Use the
the YY alone
alone and
and backwards
backwards compatibility
compatibility with
with
B/W
B/W TV!
TV!
•• These
These days
days when
when you
you convert
convert RGB
RGB image
image to
to B/W
B/W image,
image, the
the
green
green and
and blue
blue components
components are are thrown
thrown away
away and
and red
red is
is used
used
to
to control
control shades
shades of of grey
grey (usually)
(usually)
Converting Color Spaces
Converting between
between color
color models
models can
can also
also be
be
expressed
expressed as such a matrix transform:

 Y   0 . 30 0 . 59 0 .11   R 
 I    0 . 60  0 . 28  0 . 32   G 
  
 Q   0 .21  0 . 52 0 .31   B 

Note the relative


relative unimportance
unimportance of
of blue
blue in
computing
computing the Y
Perceptually Uniform Color Space
Color space in which Euclidean distance between
two colors in space is proportional to the
perceived distance
•• CIE,
CIE, RGB,
RGB, not
not perceptually
perceptually uniform
uniform
–– Example
Example with
with RGB
RGB
–– LUV
LUV was
was created
created toto be
be
perceptually
perceptually uniform
uniform
The CMY Color Model
Cyan, magenta, and yellow are the complements
of red, green, and blue
•• We
We can
can use
use them
them as
as filters
filters to
to subtract
subtract from
from white
white
•• The
The space
space is
is the
the same
same as
as RGB
RGB except
except the
the origin
origin is
is white
white
instead
instead of
of black
black
C  1  R 
M   1   G 
This is useful for hardcopy      
devices like laser printers  Y  1  B 

•• IfIf you
you put
put cyan
cyan ink
ink on
on the
the page,
page, no
no red
red light
light is
is reflected
reflected
•• Add
Add black
black as
as option
option (CMYK)
(CMYK) to
to match
match equal
equal parts
parts CMY
CMY

You might also like