CS148: Introduction to Computer Graphics and Imaging Light and Color
Painting by Cheryl Yaney
Topics
Physics of light Electromagnetic spectrum Fundamental operations: add, filter, measure Perception of color Trichromatic theory Luminance Color spaces Art Color terms Color wheels and intuitive color spaces
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 1 Physics of Light
Light
Image from Clive Maxfield
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 2 Electromagnetic Spectrum
Image from Clive Maxfield
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Sources
Visible (300-800 nm) spectra power distribution
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 3 Sources
Visible (300 – 800 nm) spectra power distribution
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Adding Light Energy
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 4 Reflecting Light
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Light Operations
Add spectra
Multiply spectra
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 5 Measuring Light
Photon detector
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Perception of Color
Page 6 Color Matching
Adjust brightness of three primaries to “match” color C – color to be matched Lasers: R = 700 nm, G = 546 nm, B = 435 nm
C R G B
C = R + G + B
Result: all colors can be matched with three colors Therefore: humans have trichromatic color vision CS148 Lecture 10 Pat Hanrahan, Winter 2009
RGB Color
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 7 Human Retina: Three Types of Cones
From http://webvision.med.utah.edu/imageswv/fovmoswv.jpeg CS148 Lecture 10 Pat Hanrahan, Winter 2009
Response of Three Cones
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 8 Cone Response
Three cones
L (long)
M (medium)
S (short)
Metamerism: Different spectra, same color response
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Color Blindness: Ishihara Test
Normal
http://www.toledo-bend.com/colorblind/Ishihara.html
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 9 Color Blindness: Ishihara Test
Normal Deuteranopia
http://www.toledo-bend.com/colorblind/Ishihara.html
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Types of Color Blindness
Dichromacy: missing pigment (genetic, 10% M, 1% F) Protanopia – missing L Deuteranopia – missing M (red-green) Tritanopia – missing S
Normal Deuteranopia Tritanopia www.vischeck.com CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 10 Rod
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Luminance
Compare color to a gray source
Luminance (B&W TV)
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 11 Spectral Matching Functions
Match each pure (monochromatic) color in the visible spectrum (rainbow) and record the color coordinates as a function of wavelength
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Absolute/Calibrated Color Space
Spectral matching functions define a horseshoe curve
CIE XYZ Y is luminance
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 12 CIE XYZ Chromaticity Coordinates
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Grassman’s Laws
Color matching is linear!
1. Scaling the color and the primaries by the same factor preserves the match
2. To match a color formed by adding two colors, add the primaries that match each color
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 13 Gamut
All perceivable colors are inside the horseshoe curve (gamut) - A spectra is a sum of monochromatic colors with positive weights equal to the amount of energy of that color - Sum of vectors with positive weights must lie inside the convex hull of the vectors
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Early Visual Processing
+ - + + + + + + -
A R-G Y-B
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 14 Perceptual Organization
Not “RGB” as in Colorimetry
Lightness
Colorfulness
Hue
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Munsell Color Space
Book of painted chips Perceptually uniform
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 15 CIE Lab
CS148 Lecture 10 Pat Hanrahan, Winter 2009
CIELAB
Color distance:
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 16 Intuitive Color Space
Tints White Color
Tones Gray Shades
Black
MetaDesign Color Picker
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 17 HSV
M=max(R,G,B) K m=min(R,G,B) M
= r=(M-R)/(M-m) m g=(M-G)/(M-m) W b=(M-B)/(M-m)
R G B R G B if(M==R) V=M H=(6+b-g)/6 S=(M-m)/M .... CS148 Lecture 10 Pat Hanrahan, Winter 2009
Things to Remember
Physics of color Addition, transmission/reflection, measurement Perception of color Three colors will match another color Trichromatic because we have 3 cones Explains metamerism, color blindness Color matching is linear Perceptual organization in terms of BW, YB, RG Hue-Saturation-Value
CS148 Lecture 10 Pat Hanrahan, Winter 2009
Page 18