SLIDE 1
2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Color and - - PowerPoint PPT Presentation
2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Color and - - PowerPoint PPT Presentation
2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Color and compositing The prism experiment 2 Infrared light: thermometers (Herschel, 1800) Ultraviolet light: silver chloride (Ritter, 1801) More than visible light Visible light: prism
SLIDE 2
SLIDE 3
The prism experiment
2
SLIDE 4
More than visible light
Visible light: prism experiment (Newton, 1666) Infrared light: thermometers (Herschel, 1800) Ultraviolet light: silver chloride (Ritter, 1801)
3
SLIDE 5
More than visible light
Visible light: prism experiment (Newton, 1666) Infrared light: thermometers (Herschel, 1800) Ultraviolet light: silver chloride (Ritter, 1801)
3
SLIDE 6
More than visible light
Visible light: prism experiment (Newton, 1666) Infrared light: thermometers (Herschel, 1800) Ultraviolet light: silver chloride (Ritter, 1801)
3
SLIDE 7
Full electromagnetic spectrum
4
SLIDE 8
Radiometry
Measurement of radiant energy in terms of absolute power Wave vs. particle
- Wavelength ( ), frequency (
c ), and amplitude (A)
- Energy (E
h , where h is Planck’s constant) and fmux ( ) Pure spectral light (monochromatic colors) Spectrometer
5
SLIDE 9
Radiometry
Measurement of radiant energy in terms of absolute power Wave vs. particle
- Wavelength (λ), frequency (ν = c
λ), and amplitude (A)
- Energy (E = hν, where h is Planck’s constant) and fmux (Φ)
Pure spectral light (monochromatic colors) Spectrometer
5
SLIDE 10
Radiometry
Measurement of radiant energy in terms of absolute power Wave vs. particle
- Wavelength (λ), frequency (ν = c
λ), and amplitude (A)
- Energy (E = hν, where h is Planck’s constant) and fmux (Φ)
Pure spectral light (monochromatic colors) Spectrometer
5
SLIDE 11
Radiometry
Measurement of radiant energy in terms of absolute power Wave vs. particle
- Wavelength (λ), frequency (ν = c
λ), and amplitude (A)
- Energy (E = hν, where h is Planck’s constant) and fmux (Φ)
Pure spectral light (monochromatic colors) Spectrometer
5
SLIDE 12
Colors are spectral distributions
6
SLIDE 13
Spectral representation
As a continuous function of c(λ) c : R>0 → R≥0, λ → Aλ As a discrete set of values c
i
c
1 2 n
R R
i
A
i
Light emitter has a spectrum, material properties modulate the refmected spectrum (Fluorescence is something else)
7
SLIDE 14
Spectral representation
As a continuous function of c(λ) c : R>0 → R≥0, λ → Aλ As a discrete set of values c(λi) c : {λ1, λ2, . . . , λn} ⊂ R>0 → R≥0 λi → Aλi Light emitter has a spectrum, material properties modulate the refmected spectrum (Fluorescence is something else)
7
SLIDE 15
Spectral representation
As a continuous function of c(λ) c : R>0 → R≥0, λ → Aλ As a discrete set of values c(λi) c : {λ1, λ2, . . . , λn} ⊂ R>0 → R≥0 λi → Aλi Light emitter has a spectrum, material properties modulate the refmected spectrum (Fluorescence is something else)
7
SLIDE 16
Black-body radiation
B(ν, T) = 2hν3 c2
- e
hν kBT − 1
−1, where kB is Boltsmann’s constant
2E+11 4E+11 6E+11 8E+11 500 1000 1500 2000 Spectral energy density / kJ/m3nm Wavelength / nm 3500K 4000K 4500K 5000K 5500K
8
SLIDE 17
Photometry
Measurement light in terms of perceived brightness to human eye Visible light 390nm 700nm approximately
9
SLIDE 18
Photometry
Measurement light in terms of perceived brightness to human eye Visible light λ ∈ [390nm, 700nm] approximately
9
SLIDE 19
Photometry
Measurement light in terms of perceived brightness to human eye Visible light λ ∈ [390nm, 700nm] approximately
Film or sensor Mirror Lenses Aperture Prism Viewfinder
9
SLIDE 20
Photopic vision
Well-lit conditions Cones: Three types of retinal cells with distinct spectral responses Highly concentrated on fovea Response curves S (short ), M (medium ), L (long )
- Peaks at
420nm, 534nm, and 564nm
- Overlap each other
- Not R, G, and B
What about the color-blind? Are there tetrachromats among us?
10
SLIDE 21
Photopic vision
Well-lit conditions Cones: Three types of retinal cells with distinct spectral responses Highly concentrated on fovea Response curves S (short ), M (medium ), L (long )
- Peaks at
420nm, 534nm, and 564nm
- Overlap each other
- Not R, G, and B
What about the color-blind? Are there tetrachromats among us?
10
SLIDE 22
Photopic vision
Well-lit conditions Cones: Three types of retinal cells with distinct spectral responses Highly concentrated on fovea Response curves S (short ), M (medium ), L (long )
- Peaks at
420nm, 534nm, and 564nm
- Overlap each other
- Not R, G, and B
What about the color-blind? Are there tetrachromats among us?
10
SLIDE 23
Photopic vision
Well-lit conditions Cones: Three types of retinal cells with distinct spectral responses Highly concentrated on fovea Response curves S (short λ), M (medium λ), L (long λ)
- Peaks at λ = 420nm, λ = 534nm, and λ = 564nm
- Overlap each other
- Not R, G, and B
What about the color-blind? Are there tetrachromats among us?
10
SLIDE 24
Photopic vision
Well-lit conditions Cones: Three types of retinal cells with distinct spectral responses Highly concentrated on fovea Response curves S (short λ), M (medium λ), L (long λ)
- Peaks at λ = 420nm, λ = 534nm, and λ = 564nm
- Overlap each other
- Not R, G, and B
What about the color-blind? Are there tetrachromats among us?
10
SLIDE 25
Photopic vision
Well-lit conditions Cones: Three types of retinal cells with distinct spectral responses Highly concentrated on fovea Response curves S (short λ), M (medium λ), L (long λ)
- Peaks at λ = 420nm, λ = 534nm, and λ = 564nm
- Overlap each other
- Not R, G, and B
What about the color-blind? Are there tetrachromats among us?
10
SLIDE 26
Scotopic vision
Low-light conditions Rods: One type of retinal cell Mostly peripheral 20 more numerous, 1000 more sensitive than cones Response curve
- R: peak at
498nm (between S and M) Things look “gray-bluish” at night
11
SLIDE 27
Scotopic vision
Low-light conditions Rods: One type of retinal cell Mostly peripheral 20 more numerous, 1000 more sensitive than cones Response curve
- R: peak at
498nm (between S and M) Things look “gray-bluish” at night
11
SLIDE 28
Scotopic vision
Low-light conditions Rods: One type of retinal cell Mostly peripheral 20 more numerous, 1000 more sensitive than cones Response curve
- R: peak at
498nm (between S and M) Things look “gray-bluish” at night
11
SLIDE 29
Scotopic vision
Low-light conditions Rods: One type of retinal cell Mostly peripheral 20× more numerous, 1000× more sensitive than cones Response curve
- R: peak at
498nm (between S and M) Things look “gray-bluish” at night
11
SLIDE 30
Scotopic vision
Low-light conditions Rods: One type of retinal cell Mostly peripheral 20× more numerous, 1000× more sensitive than cones Response curve
- R: peak at λ = 498nm (between S and M)
Things look “gray-bluish” at night
11
SLIDE 31
Scotopic vision
Low-light conditions Rods: One type of retinal cell Mostly peripheral 20× more numerous, 1000× more sensitive than cones Response curve
- R: peak at λ = 498nm (between S and M)
Things look “gray-bluish” at night
11
SLIDE 32
Human photoreceptor distribution
Temporal Eccentricity (degrees) Nasal 20 40 60 80 100 120 140 160 Receptor density (mm−2 × 103) 80 80 60 60 40 40 20 20 Cones Cones Rods Rods Optic disk 12
SLIDE 33
Luminous efficiency function
Spectral sensitivity V(λ) of human perception of brightness Different for photopic and scotopic vision Immense dynamic range 1 1010 (brightness adaptation) Convert radiant intensity (W/sr) to luminous intensity (cd) v c c V d
13
SLIDE 34
Luminous efficiency function
Spectral sensitivity V(λ) of human perception of brightness Different for photopic and scotopic vision Immense dynamic range 1 1010 (brightness adaptation) Convert radiant intensity (W/sr) to luminous intensity (cd) v c c V d
13
SLIDE 35
Luminous efficiency function
Spectral sensitivity V(λ) of human perception of brightness Different for photopic and scotopic vision Immense dynamic range 1 : 1010 (brightness adaptation) Convert radiant intensity (W/sr) to luminous intensity (cd) v c c V d
13
SLIDE 36
Luminous efficiency function
Spectral sensitivity V(λ) of human perception of brightness Different for photopic and scotopic vision Immense dynamic range 1 : 1010 (brightness adaptation) Convert radiant intensity (W/sr) to luminous intensity (cd) v(c) =
- λ
c(λ)V(λ)dλ
13
SLIDE 37
Photopic luminous efficiency function
14
SLIDE 38
Lightness
Nonlinear perceptual response to brightness Power law L 116 100 Y Y0
1 3
0 16 Weber law of just noticeable difference L Y 100
15
SLIDE 39
Lightness
Nonlinear perceptual response to brightness Power law L∗ ≈ 116 100 Y Y0 1
3
− 0.16 Weber law of just noticeable difference L Y 100
15
SLIDE 40
Lightness
Nonlinear perceptual response to brightness Power law L∗ ≈ 116 100 Y Y0 1
3
− 0.16 Weber law of just noticeable difference ∆L∗ ≈ Y 100
15
SLIDE 41
Gamma correction
Created to compensate for input-output characteristic of CRT displays Y = V2.5 = Vγ Today, due to remarkable coincidence, it is used for encoding effjciency
16
SLIDE 42
Gamma correction
Created to compensate for input-output characteristic of CRT displays Y = V2.5 = Vγ Today, due to remarkable coincidence, it is used for encoding effjciency
16
SLIDE 43
Gamma correction
Created to compensate for input-output characteristic of CRT displays Y = V2.5 = Vγ Today, due to remarkable coincidence, it is used for encoding effjciency
16
SLIDE 44
Gamma correction
Created to compensate for input-output characteristic of CRT displays Y = V2.5 = Vγ Today, due to remarkable coincidence, it is used for encoding effjciency
16
SLIDE 45
Illusion
17
SLIDE 46
Modeling color perception
1st attempt: Measure spectral distribution of stimulus
- Convex combinations of monochromatic colors
- Could use spectrophotometer to measure c(λ).
- But how to would you reproduce it?
2nd attempt: Measure optical nerve response
- Remove eye, attach wires to cones: The Matrix
- Re-inject signal to reproduce
- Painful, but only 3 values per color
18
SLIDE 47
Modeling color perception
1st attempt: Measure spectral distribution of stimulus
- Convex combinations of monochromatic colors
- Could use spectrophotometer to measure c(λ).
- But how to would you reproduce it?
2nd attempt: Measure optical nerve response
- Remove eye, attach wires to cones: The Matrix
- Re-inject signal to reproduce
- Painful, but only 3 values per color
18
SLIDE 48
Modeling color perception
3rd attempt: Linear algebra Measuring
- c
is the target color’s spectral distribution
- L
, M , and S the spectral sensitivities for the cones
- Inner-product functions f and g is
f g f g d
- The cone responses to c must be
Sc c S Mc c M and Lc c L
19
SLIDE 49
Modeling color perception
3rd attempt: Linear algebra Measuring
- c(λ) is the target color’s spectral distribution
- L
, M , and S the spectral sensitivities for the cones
- Inner-product functions f and g is
f g f g d
- The cone responses to c must be
Sc c S Mc c M and Lc c L
19
SLIDE 50
Modeling color perception
3rd attempt: Linear algebra Measuring
- c(λ) is the target color’s spectral distribution
- L(λ), M(λ), and S(λ) the spectral sensitivities for the cones
- Inner-product functions f and g is
f g f g d
- The cone responses to c must be
Sc c S Mc c M and Lc c L
19
SLIDE 51
Modeling color perception
3rd attempt: Linear algebra Measuring
- c(λ) is the target color’s spectral distribution
- L(λ), M(λ), and S(λ) the spectral sensitivities for the cones
- Inner-product functions f and g is
f, g = ∞
−∞
f(λ)g(λ)dλ
- The cone responses to c must be
Sc c S Mc c M and Lc c L
19
SLIDE 52
Modeling color perception
3rd attempt: Linear algebra Measuring
- c(λ) is the target color’s spectral distribution
- L(λ), M(λ), and S(λ) the spectral sensitivities for the cones
- Inner-product functions f and g is
f, g = ∞
−∞
f(λ)g(λ)dλ
- The cone responses to c must be
Sc = c, S, Mc = c, M, and Lc = c, L
19
SLIDE 53
Cone spectral sensitivities (not to scale)
20
SLIDE 54
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r Gc g Bc b S Sc Rc r Gc g Bc b M Mc Rc r Gc g Bc b L Lc Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 55
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r Gc g Bc b S Sc Rc r Gc g Bc b M Mc Rc r Gc g Bc b L Lc Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 56
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r Gc g Bc b S Sc Rc r Gc g Bc b M Mc Rc r Gc g Bc b L Lc Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 57
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r + Gc g + Bc b, S = Sc Rc r + Gc g + Bc b, M = Mc Rc r + Gc g + Bc b, L = Lc Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 58
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r + Gc g + Bc b, S = Sc Rc r + Gc g + Bc b, M = Mc Rc r + Gc g + Bc b, L = Lc ⇔ Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc = Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 59
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r + Gc g + Bc b, S = Sc Rc r + Gc g + Bc b, M = Mc Rc r + Gc g + Bc b, L = Lc ⇔ Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc = Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 60
Modeling color perception
Reproduction
- Assume 3 different stimuli colors r(λ), g(λ), and b(λ)
- Find stimuli intensities Rc, Gc and Bc that correspond to c
- I.e., intensities that reproduce responses Sc, Mc, and Lc
Rc r + Gc g + Bc b, S = Sc Rc r + Gc g + Bc b, M = Mc Rc r + Gc g + Bc b, L = Lc ⇔ Sr Sg Sb Mr Mg Mb Lr Lg Lb Rc Gc Bc = Sc Mc Lc Stimuli must be linearly independent Result Rc, Gc, or Bc could be non-convex
- There is no negative light…
21
SLIDE 61
Space of visible colors
All convex combinations of visible monochromatic colors
- Could use entire spectrum
Unnecessary (most of the time) due to metamerism
- Different spectra result in same perceived color S
M L
- E.g., c and Rcr
Gcg Bcb Obtain Rc, Gc, and Bc directly from c and RGB color matching functions Rc c R Gc c G Bc c B How to measure color matching functions R, G, and B
22
SLIDE 62
Space of visible colors
All convex combinations of visible monochromatic colors
- Could use entire spectrum
Unnecessary (most of the time) due to metamerism
- Different spectra result in same perceived color
- S
M L
- E.g., c and Rcr + Gcg + Bcb
Obtain Rc, Gc, and Bc directly from c and RGB color matching functions Rc c R Gc c G Bc c B How to measure color matching functions R, G, and B
22
SLIDE 63
Space of visible colors
All convex combinations of visible monochromatic colors
- Could use entire spectrum
Unnecessary (most of the time) due to metamerism
- Different spectra result in same perceived color
- S
M L
- E.g., c and Rcr + Gcg + Bcb
Obtain Rc, Gc, and Bc directly from c and RGB color matching functions Rc = c, R Gc = c, G Bc = c, B. How to measure color matching functions R, G, and B
22
SLIDE 64
Space of visible colors
All convex combinations of visible monochromatic colors
- Could use entire spectrum
Unnecessary (most of the time) due to metamerism
- Different spectra result in same perceived color
- S
M L
- E.g., c and Rcr + Gcg + Bcb
Obtain Rc, Gc, and Bc directly from c and RGB color matching functions Rc = c, R Gc = c, G Bc = c, B. How to measure color matching functions R, G, and B
22
SLIDE 65
CIE 1931 RGB color matching functions
23
SLIDE 66
XYZ color matching functions
Visible colors always use non-negative coordinates Linear transformation to R, G, B Y is the photopic luminosity function Equal-energy radiator (constant SPD in visible spectrum, illuminant E) is at
1 3 1 3 1 3
Z ended up almost equal to S
24
SLIDE 67
XYZ color matching functions
Visible colors always use non-negative coordinates Linear transformation to R, G, B Y is the photopic luminosity function Equal-energy radiator (constant SPD in visible spectrum, illuminant E) is at
1 3 1 3 1 3
Z ended up almost equal to S
24
SLIDE 68
XYZ color matching functions
Visible colors always use non-negative coordinates Linear transformation to R, G, B Y is the photopic luminosity function Equal-energy radiator (constant SPD in visible spectrum, illuminant E) is at
1 3 1 3 1 3
Z ended up almost equal to S
24
SLIDE 69
XYZ color matching functions
Visible colors always use non-negative coordinates Linear transformation to R, G, B Y is the photopic luminosity function Equal-energy radiator (constant SPD in visible spectrum, illuminant E) is at
- 1
3 1 3 1 3
- Z ended up almost equal to S
24
SLIDE 70
XYZ color matching functions
Visible colors always use non-negative coordinates Linear transformation to R, G, B Y is the photopic luminosity function Equal-energy radiator (constant SPD in visible spectrum, illuminant E) is at
- 1
3 1 3 1 3
- Z ended up almost equal to S
24
SLIDE 71
XYZ color matching functions
25
SLIDE 72
CIE chromaticity diagram
Similar to RP2
- Given α > 0,
- αX
αY αZ
- have same chromaticity
- Different brightness
Separation of chromaticity and brightness x X X Y Z y Y X Y Z
26
SLIDE 73
CIE chromaticity diagram
Similar to RP2
- Given α > 0,
- αX
αY αZ
- have same chromaticity
- Different brightness
Separation of chromaticity and brightness x = X X + Y + Z y = Y X + Y + Z
26
SLIDE 74
CIE chromaticity diagram
27
SLIDE 75
CIE chromaticity diagram
Horseshoe shape Locus of monochromatic colors Locus of black-body colors Line of purples Color gamut Color calibration and matching
28
SLIDE 76
CIE chromaticity diagram
Horseshoe shape Locus of monochromatic colors Locus of black-body colors Line of purples Color gamut Color calibration and matching
28
SLIDE 77
CIE chromaticity diagram
Horseshoe shape Locus of monochromatic colors Locus of black-body colors Line of purples Color gamut Color calibration and matching
28
SLIDE 78
CIE chromaticity diagram
Horseshoe shape Locus of monochromatic colors Locus of black-body colors Line of purples Color gamut Color calibration and matching
28
SLIDE 79
CIE chromaticity diagram
Horseshoe shape Locus of monochromatic colors Locus of black-body colors Line of purples Color gamut Color calibration and matching
28
SLIDE 80
CIE chromaticity diagram
Horseshoe shape Locus of monochromatic colors Locus of black-body colors Line of purples Color gamut Color calibration and matching
28
SLIDE 81
Other color spaces
sRGB [IEC Project Team 61966, 1998] R G B = γ(Rℓ) γ(Gℓ) γ(Bℓ) , Rℓ Gℓ Bℓ = 3.2406 −1.5372 −0.4986 −0.9689 1.8758 0.0415 0.0557 −0.2040 1.0570 XD65 YD65 ZD65 γ(u) = 12.92u u < 0.0031308 1.055u1/2.4 − 0.055
- therwise
Munsel (HSV and HSL) Additive (CMY and CMYK) TV (PAL YUV, NTSC YIQ) Perceptual (CIE L a b ) Opponent color models
29
SLIDE 82
Other color spaces
sRGB [IEC Project Team 61966, 1998] R G B = γ(Rℓ) γ(Gℓ) γ(Bℓ) , Rℓ Gℓ Bℓ = 3.2406 −1.5372 −0.4986 −0.9689 1.8758 0.0415 0.0557 −0.2040 1.0570 XD65 YD65 ZD65 γ(u) = 12.92u u < 0.0031308 1.055u1/2.4 − 0.055
- therwise
Munsel (HSV and HSL) Additive (CMY and CMYK) TV (PAL YUV, NTSC YIQ) Perceptual (CIE L a b ) Opponent color models
29
SLIDE 83
Other color spaces
sRGB [IEC Project Team 61966, 1998] R G B = γ(Rℓ) γ(Gℓ) γ(Bℓ) , Rℓ Gℓ Bℓ = 3.2406 −1.5372 −0.4986 −0.9689 1.8758 0.0415 0.0557 −0.2040 1.0570 XD65 YD65 ZD65 γ(u) = 12.92u u < 0.0031308 1.055u1/2.4 − 0.055
- therwise
Munsel (HSV and HSL) Additive (CMY and CMYK) TV (PAL YUV, NTSC YIQ) Perceptual (CIE L a b ) Opponent color models
29
SLIDE 84
Other color spaces
sRGB [IEC Project Team 61966, 1998] R G B = γ(Rℓ) γ(Gℓ) γ(Bℓ) , Rℓ Gℓ Bℓ = 3.2406 −1.5372 −0.4986 −0.9689 1.8758 0.0415 0.0557 −0.2040 1.0570 XD65 YD65 ZD65 γ(u) = 12.92u u < 0.0031308 1.055u1/2.4 − 0.055
- therwise
Munsel (HSV and HSL) Additive (CMY and CMYK) TV (PAL YUV, NTSC YIQ) Perceptual (CIE L a b ) Opponent color models
29
SLIDE 85
Other color spaces
sRGB [IEC Project Team 61966, 1998] R G B = γ(Rℓ) γ(Gℓ) γ(Bℓ) , Rℓ Gℓ Bℓ = 3.2406 −1.5372 −0.4986 −0.9689 1.8758 0.0415 0.0557 −0.2040 1.0570 XD65 YD65 ZD65 γ(u) = 12.92u u < 0.0031308 1.055u1/2.4 − 0.055
- therwise
Munsel (HSV and HSL) Additive (CMY and CMYK) TV (PAL YUV, NTSC YIQ) Perceptual (CIE L∗a∗b∗) Opponent color models
29
SLIDE 86
Other color spaces
sRGB [IEC Project Team 61966, 1998] R G B = γ(Rℓ) γ(Gℓ) γ(Bℓ) , Rℓ Gℓ Bℓ = 3.2406 −1.5372 −0.4986 −0.9689 1.8758 0.0415 0.0557 −0.2040 1.0570 XD65 YD65 ZD65 γ(u) = 12.92u u < 0.0031308 1.055u1/2.4 − 0.055
- therwise
Munsel (HSV and HSL) Additive (CMY and CMYK) TV (PAL YUV, NTSC YIQ) Perceptual (CIE L∗a∗b∗) Opponent color models
29
SLIDE 87
Transparency
SLIDE 88
Seminal work by Porter and Duff [1984]
Semitransparent color f on top of opaque background color b
- Assume probability of light hitting f is α
- Refmected color (integrated over small area) is
f, α ⊕ b = αf + (1 − α)b
- This is what we call alpha blending or the over operator
30
SLIDE 89
Compositing
Now imagine f1, α1 on top of f2, α2 on top of b
- Refmected color is
f1, α1 ⊕ (f2, α2 ⊕ b) = α1f1 + (1 − α1)
- α2f2 + (1 − α2)b
- Can we combine f1
1 and f2 2 into a single material f
? f 1 b
1f1
1
1 2f2
1
2 b 1f1
1
1 2f2
1
1
1
2 b
So we have 1 b 1
1
1
2 b
f
1f1
1
1 2f2 1
1
1 2
f
1f1
1
1 2f2 31
SLIDE 90
Compositing
Now imagine f1, α1 on top of f2, α2 on top of b
- Refmected color is
f1, α1 ⊕ (f2, α2 ⊕ b) = α1f1 + (1 − α1)
- α2f2 + (1 − α2)b
- Can we combine f1, α1 and f2, α2 into a single material f, α?
αf + (1 − α)b = α1f1 + (1 − α1)
- α2f2 + (1 − α2)b
- = α1f1 + (1 − α1)α2f2 + (1 − α1)(1 − α2)b
So we have 1 b 1
1
1
2 b
f
1f1
1
1 2f2 1
1
1 2
f
1f1
1
1 2f2 31
SLIDE 91
Compositing
Now imagine f1, α1 on top of f2, α2 on top of b
- Refmected color is
f1, α1 ⊕ (f2, α2 ⊕ b) = α1f1 + (1 − α1)
- α2f2 + (1 − α2)b
- Can we combine f1, α1 and f2, α2 into a single material f, α?
αf + (1 − α)b = α1f1 + (1 − α1)
- α2f2 + (1 − α2)b
- = α1f1 + (1 − α1)α2f2 + (1 − α1)(1 − α2)b
So we have (1 − α)b = (1 − α1)(1 − α2)b αf = α1f1 + (1 − α1)α2f2 ⇒ α = α1 + (1 − α1)α2 αf = α1f1 + (1 − α1)α2f2
31
SLIDE 92
Compositing
(1 − α)b = (1 − α1)(1 − α2)b αf = α1f1 + (1 − α1)α2f2 ⇒ α = α1 + (1 − α1)α2 αf = α1f1 + (1 − α1)α2f2 Setting f f, f1
1f1,
and f2
2f2, we obtain 1
1
1 2
f f1 1
1 f2
This is what we call pre-multiplied alpha Blending becomes associative f1
1
f2
2
b f1
1
f2
2
b Should we blend front-to-back or back-to-front?
32
SLIDE 93
Compositing
(1 − α)b = (1 − α1)(1 − α2)b αf = α1f1 + (1 − α1)α2f2 ⇒ α = α1 + (1 − α1)α2 αf = α1f1 + (1 − α1)α2f2 Setting ˜ f = αf, ˜ f1 = α1f1, and ˜ f2 = α2f2, we obtain α = α1 + (1 − α1)α2 ˜ f = ˜ f1 + (1 − α1)˜ f2 This is what we call pre-multiplied alpha Blending becomes associative f1
1
f2
2
b f1
1
f2
2
b Should we blend front-to-back or back-to-front?
32
SLIDE 94
Compositing
(1 − α)b = (1 − α1)(1 − α2)b αf = α1f1 + (1 − α1)α2f2 ⇒ α = α1 + (1 − α1)α2 αf = α1f1 + (1 − α1)α2f2 Setting ˜ f = αf, ˜ f1 = α1f1, and ˜ f2 = α2f2, we obtain α = α1 + (1 − α1)α2 ˜ f = ˜ f1 + (1 − α1)˜ f2 This is what we call pre-multiplied alpha Blending becomes associative f1
1
f2
2
b f1
1
f2
2
b Should we blend front-to-back or back-to-front?
32
SLIDE 95
Compositing
(1 − α)b = (1 − α1)(1 − α2)b αf = α1f1 + (1 − α1)α2f2 ⇒ α = α1 + (1 − α1)α2 αf = α1f1 + (1 − α1)α2f2 Setting ˜ f = αf, ˜ f1 = α1f1, and ˜ f2 = α2f2, we obtain α = α1 + (1 − α1)α2 ˜ f = ˜ f1 + (1 − α1)˜ f2 This is what we call pre-multiplied alpha Blending becomes associative ˜ f1, α1 ⊕ (˜ f2, α2 ⊕ b) = (˜ f1, α1 ⊕ ˜ f2, α2) ⊕ b Should we blend front-to-back or back-to-front?
32
SLIDE 96
Compositing
(1 − α)b = (1 − α1)(1 − α2)b αf = α1f1 + (1 − α1)α2f2 ⇒ α = α1 + (1 − α1)α2 αf = α1f1 + (1 − α1)α2f2 Setting ˜ f = αf, ˜ f1 = α1f1, and ˜ f2 = α2f2, we obtain α = α1 + (1 − α1)α2 ˜ f = ˜ f1 + (1 − α1)˜ f2 This is what we call pre-multiplied alpha Blending becomes associative ˜ f1, α1 ⊕ (˜ f2, α2 ⊕ b) = (˜ f1, α1 ⊕ ˜ f2, α2) ⊕ b Should we blend front-to-back or back-to-front?
32
SLIDE 97
References
IEC Project Team 61966. Colour measurement and management in multimedia systems and equipment. IEC/4WD 61966-2-1, 1998. Part 2.1: Default RGB colour space — sRGB.
- B. MacEvoy. Hardprint: Color vision, 2015. URL
http://www.handprint.com/LS/CVS/color.html.
- T. Porter and T. Duff. Compositing digital images. Computer Graphics