Einführung in Visual Computing 186.822 Color and Color Models Werner Purgathofer
Einführung in Visual Computing186.822
Color and Color Models
Werner Purgathofer
Color
problem specificationlight and perceptioncolorimetrydevice color systemscolor ordering systemscolor symbolism
Werner Purgathofer 2
Color - Why Do We Care?
Visual Computing is all about the generation and the manipulation of color imagesproper understanding & handling of color is necessary at every step
Werner Purgathofer 3
Color - A Visual Sensation
Werner Purgathofer 4
eye brainlightstimulus
nervesignal
object
electromagnetic rays color sensation
realm of direct observables realm of psychology
What is Light?
“light” = narrow frequency band of electromagnetic spectrumred border: 380 THz ≈ 780 nmviolet border: 780 THz ≈ 380 nm
Werner Purgathofer 5
frequency(Hz)
102 104 106 108 1010 1012 1014 1016 1018 1020
AM ra
dio
FM ra
dio
and
TV
mic
row
aves
infr
ared
ultr
avio
let
X-ra
ys
1016 1014 1012 1010 108 106 104 102 100 10-2
wavelength(nm)
visible
… …
Light - An Electromagnetic Wave
light is electromagnetic energymonochrome light can be described either by frequency f or wavelength λc = λ·f (c = speed of light)
shorter wavelengthequals higherfrequency
red ≈ 700 nmviolet ≈ 400 nm
Werner Purgathofer 6
Et
λ
Light – Spectrumnormally, a ray of light contains many different waves with individual frequencies the associated distribution of wavelength intensities per wave-length is referred to asthe spectrum of a givenray or light source
Werner Purgathofer 7
Light – Spectrumnormally, a ray of light contains many different waves with individual frequencies the associated distribution of wavelength intensities per wave-length is referred to asthe spectrum of a givenray or light source
Werner Purgathofer 8
Dominant Wavelength | Frequency
dominant wavelength | frequency (hue, color)brightness (area under the curve)purity
Werner Purgathofer 9
ED
ED – EW ED ... dominant energy densityEW ... white light energy density
white lightenergy
wave-length
700 nm400 nm
energy
wave-length
greenish light
dominantwavelength
ED
EW
The Human Eye
retina containsrods: b/wcones: color
Werner Purgathofer 10
rods
cones
lens
visual axisoptical axis
fovea
aqueous[Augenkammer]
cornea[Hornhaut]
iris [Regen-bogen-
haut]
macula lutea[gelber Fleck]
nerve
retina[Netzhaut]
vitreous humor[Glaskörper]
optic disc[Papille]
retina
opticalnerve
blindspot
The Human Eye
3 types of cones
differentwavelengthsensitivities:
redgreenblue
Werner Purgathofer 11
fraction ofabsorbed light
1%2%4%8%16%
400 440 480 520 560 600 640 680
λ
Color Blindness
red/green blindnessred & green cones too similar
Werner Purgathofer 12
fraction ofabsorbed light
1%2%4%8%16%
400 440 480 520 560 600 640 680
λ
Color Blindness
red/green blindnessred & green cones too similar
blue blindnessno blue cones
Werner Purgathofer 13
fraction ofabsorbed light
1%2%4%8%16%
400 440 480 520 560 600 640 680
λ
Color Blindness
red/green blindnessred & green cones too similar
blue blindnessno blue cones
monochromatismall cones missing
Werner Purgathofer 14
fraction ofabsorbed light
1%2%4%8%16%
400 440 480 520 560 600 640 680
λ
Color Blindness Tests
Werner Purgathofer 15
What do you see?
Color Blindness Tests
Werner Purgathofer 16
5 = normalnothing = red/green blind
2 = red/green weaknothing = normal
Color Blindness Tests
Werner Purgathofer 17
What do you see?
Color Blindness Tests
Werner Purgathofer 18
8 = normal3 = red/green weaknothing = red/green blind
8 = red/green blind12 = blue/yellow blind182 = normal
Color Blindness Example
Werner Purgathofer 19
normal vision
Color Blindness Example
Werner Purgathofer 20
normal vision red/green weakness
Color Blindness Example
Werner Purgathofer 21
normal vision red/green weaknessred/green blindness
Color Spaces
Color Metric Spaces (CIE XYZ, L*a*b*)used to measure absolute values and differences – has roots in colorimetry
Device Color Spaces (RGB, CMY, CMYK)used in conjunction with devices
Color Ordering Spaces (HSV, HLS)used to find colors according to some criterion
the distinction between them is somewhat obscured by the prevalence of multi-purpose RGB in computer graphics
Werner Purgathofer 22
What is our Goal?
to be able to quantify color in a meaningful, expressive, consistentand reproducible way
problem: color is a perceived quantity, not a direct, physical observable
Werner Purgathofer 23
Color - A Visual Sensation
Werner Purgathofer 24
eye brainlightstimulus
nervesignal
object
electromagnetic rays color sensation
realm of direct observables realm of psychology
Colorimetry
Colorimetry is the branch of color science concerned with numerically specifying the color of a physically defined visual stimulus in such manner that
stimuli with the same specification look alike (under the same viewing conditions)
stimuli that look alike have the same specificationnumbers used are continuous functions of the physical parameters
Werner Purgathofer 25
Colorimetry Properties
Colorimetry only considers the visual discriminability of physical beams of radiationfor the purposes of Colorimetry a „color“ is an equivalence class of mutually indiscriminable beamscolors in this sense cannot be said to be “red”, “green” or any other “color name”discriminability is decided before the brain - Colorimetry is not psychology
Werner Purgathofer 26
observers had to match (monochromatic)test lights by combining 3 fixed primaries
test box: compare test light with combined lightWerner Purgathofer 27
Color Matching Experiments
0 10 10 1
Werner Purgathofer 28
observers had to match (monochromatic)test lights by combining 3 fixed primaries
R = 700.0 nmG = 546.1 nmB = 435.8 nm
goal: find the unique RGB coordinates for each stimulus
Color Matching Experiments
green test test
R+G
+B
0 10 10 1
Werner Purgathofer 29
Tristimulus Values
the values RQ, GQ and BQof a stimulus Q that fulfill
are called the tristimulus values of Q
in case of a monochromatic stimulus Qλthe values Rλ, Gλ and Bλ are called spectral tristimulus values
green test test
R+G
+B
0 10 10 1Q = RQ·R + GQ·G + BQ·B
Werner Purgathofer
Color Matching Procedure
(1) test field = 700 nm -red with radiance Pref
observer adjusts luminance of R (G=0, B=0)(2) test light wavelength is decreased in constant steps
(radiance Pref stays the same) observer adjusts R, G, B
(3) repeat for entirevisible range
400 450 500 550 600 650 700 nm35030
100
nomatch
possible!?!?
0400 450 500 550 600 650 700 nm350
Werner Purgathofer 31
Color Matching Result !?
observers want to „subtract“ red light from the match side...!?
Werner Purgathofer 32
for some colors observers want to reduce red light to negative values…!?but there is no negative light…!
Color Matching Experiment Problem
0 1
green test test
R+G
+B
0 10 1
?
Werner Purgathofer 33
“Negative” Light in a Color Matching Exp.
if a match using only positive RGB values proved impossible, observers could simulate a subtraction of red from the match side by adding it to the test side
green test
test
+ R
G+B
0 10 10 10 1
Werner Purgathofer 34
CIE RGB Color Matching Functions
350 400 450 500 550 600 650 700 nm
100
0
435.
8 nm
546.
1 nm
700.
0 nm
?
r(λ)
g(λ)
b(λ)
green test test
R+G
+B
0 10 10 1
CIE XYZ
problem solution: XYZ color systemtristimulus system derived from RGBbased on 3 imaginary primariesall 3 primaries are imaginary colorsonly positive XYZ values can occur!1931 by CIE(Commission Internationale de l’Eclairage)
Werner Purgathofer 35
X
Y
Z
Werner Purgathofer 36
RGB vs. XYZ
negative component disappearsy(λ) is the achromatic luminance sensitivity
350 400 450 500 550 600 650 700 nm
r(λ)g(λ)
b(λ)
350 400 450 500 550 600 650 700 nm0
x(λ)y(λ)z(λ)
1
RGB system XYZ system
amounts of RGB primaries needed to display spectral colors
amounts of CIE primaries needed to display spectral colors
CIE Color Model Formulas
XYZ color model C(λ) = X·X + Y·Y + Z·Z(X, Y, Z are primaries)normalized chromaticity values x, y
( z = 1 – x – y )
complete description of a color: x, y, Y
Werner Purgathofer 37
ZYXXx ++= ZYX
Yy ++=1
11 X
Y
Z
CIE Chromaticity Diagram
identifying complementary colorsdetermining dominant wavelength & puritycomparing color gamuts
Werner Purgathofer 38
spectral color positions are along the boundary curve
spectral colors
purple line
y
x
purple line contains all mixtures of red and blue
Properties of CIE Diagram (2)
Werner Purgathofer 39
representing complementary colors in the chromaticity diagram
C1
C2
C
Properties of CIE Diagram (3)
Werner Purgathofer 40
determining dominant wavelength and purity with the chromaticity diagram
C1 → Cs
C2 → Cp?→ complement Csp
C1
C2
C
Csp
Cp
Cs
Properties of CIE Diagram (4)
Werner Purgathofer 41
gamut of a typical RGB monitor
only the colors inside the triangle can be produced
R
G
B
Color Spaces
Color Metric Spaces (CIE XYZ, L*a*b)used to measure absolute values and differences - roots in colorimetry
Device Color Spaces (RGB, CMY, CMYK)used in conjunction with devices
Color Ordering Spaces (HSV, HLS)used to find colors according to some criterion
the distinction between them is somewhat obscured by the prevalence of multi-purpose RGB in computer graphics
Werner Purgathofer 42
RGB Color Model
primary colors red, green, blueadditive color model (for monitors)
Werner Purgathofer 43
C(λ) = R·R + G·G + B·B
white(1,1,1)
yellow(1,1,0)
red(1,0,0)
green(0,1,0)
cyan(0,1,1)
magenta(1,0,1)
blue(0,0,1)
black(0,0,0)
RGB Color Model Images
Werner Purgathofer 44
3 views of the RGB color cube
Gamuts of RGB Monitors
Werner Purgathofer 45Werner Purgathofer 45
monitor gamuts can be very differentno monitor can display all colors
CMY Color Model
primary colors:cyan, magenta, yellowsubtractive color model(for hardcopy devices)
C = G + B, using C “subtracts” R
Werner Purgathofer 46
−
=
BGR
YMC
111yellow
(0,0,1)
red(0,1,1)
green(1,0,1)
cyan(1,0,0)
magenta(0,1,0) blue
(1,1,0)
black(1,1,1)
white(0,0,0)
CMY Color Model Images
Werner Purgathofer 47
3 views of the CMY color cube
Gamuts of CMY(K) Printers
Werner Purgathofer 48Werner Purgathofer 48
printer gamuts can be very differentno printer can display all colors
Color Spaces
Color Metric Spaces (CIE XYZ, L*a*b)used to measure absolute values and differences - roots in colorimetry
Device Color Spaces (RGB, CMY, CMYK)used in conjunction with devices
Color Ordering Spaces (HSV, HLS)used to find colors according to some criterion
the distinction between them is somewhat obscured by the prevalence of multi-purpose RGB in computer graphics
Werner Purgathofer 49
Color Ordering Systems (COS)
primary aim: enable theuser to intuitively choose colour values according to certain criteriachoice can yield single or multiple colour valuesexamples: HSV, HLS,Munsell, NCS, RAL Design, Coloroidused in bottom-up parts of a design processsometimes physical samples are provided
Werner Purgathofer 50
HSV Color Modelmore intuitive color specificationderived from the RGB color model:
when the RGB color cube is viewed along the diagonal from white to black, the color cube outline is a hexagon
Werner Purgathofer 51
RGB Color Cube
G
B
white
B
Color Hexagon
HSV Color Model Hexcone
color components: hue (H) ∈ [0°, 360°]saturation (S) ∈ [0, 1]value (V) ∈ [0, 1]
Werner Purgathofer 52
HSV hexcone
HSV Color Model Hexcone
color components: hue (H) ∈ [0°, 360°]saturation (S) ∈ [0, 1]value (V) ∈ [0, 1]
Werner Purgathofer 53
HSV hexcone
HSV Color Definition
color definitionselect hue, S=1, V=1add black pigments, i.e., decrease V add white pigments, i.e., decrease S
Werner Purgathofer 54
Shades
S
cross section of the HSV hexcone showing regions for shades, tints, and tones
HLS Color Model
Werner Purgathofer 55
HLS double cone
color components: hue (H) ∈ [0°, 360°]lightness (L) ∈ [0, 1]saturation (S) ∈ [0, 1]
Color Model SummaryColorimetry:
CIE XYZ: contains all visible colors
Device Color Systems:RGB: additive device color space (monitors)CMY(K): subtractive device color space (printers)
Color Ordering Systems:HSV, HLS: for user interfaces
Werner Purgathofer 56
Color Symbolism: Some Aspects
6 to 11 basic colorscategories, hierarchiesdependent on context / applicationlarge variation in use
what is red? what is blue?what is white? !
Werner Purgathofer 57
Color in Religion
Islam: greenBuddhism:yellow, orange,red & purpleHinduism:orange, blue& blue-violetChrists:liturgical colors withouttheological connex
Werner Purgathofer 58
Political Symbol Colors
partiesrevolutions / movementsflags
Werner Purgathofer 59
at homewater pipeselectrical wireswaste separation
traffictraffic signstraffic lightsparking conceptspublic transport
...
Color Labeling
Werner Purgathofer 60
Color Labeling
technologyresistorsthermochrome colors
naturecourtship [Balz]warning colorsprotective mimicry[Tarnfarben]
…
Werner Purgathofer 61
Color Effect: BLUEdistancefaithfulness [Treue]loyalitydesirephantasymaledevinepeacecold…
Werner Purgathofer 62
Color Effect: RED
bloodenergylovefemalerich, noblelabor movementwarmcorrections…
Werner Purgathofer 63
Color Effect: GREEN
profityoung lovehopeprematurity, unripepoisonnatureneutralenvironment protection…
Werner Purgathofer 64
Color Effect: YELLOW
sunoptimismenlightenmentjealousy [Neid]
stinginess [Geiz]
warning colorwarm…
Werner Purgathofer 65
Color Effect: BLACK
end, deathsadnessnegative emotionsbad luckeleganceemptinesscold…
Werner Purgathofer 66