color: introdjmoon/cg/cg-notes/cg-color.pdf{ several sets of tsvs can generate same color perception...

28
Color: Intro To create image, need 3 things: 1. Object 2. Light 3. Viewer Same thing is true for color Color of object depends on ”natural” color (under white light) and color of light Color perceived depends on viewer * 2 viewers observing same object under same conditions may perceive different color Major topics to be discussed: Nature of light and color The eye and color perception Color models 1

Upload: others

Post on 27-Mar-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Intro

• To create image, need 3 things:

1. Object

2. Light

3. Viewer

• Same thing is true for color

– Color of object depends on ”natural” color (under white light)and color of light

– Color perceived depends on viewer

∗ 2 viewers observing same object under same conditions may perceivedifferent color

• Major topics to be discussed:

– Nature of light and color

– The eye and color perception

– Color models

1

Page 2: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Basics

• Color attributes

– Hue - basic color

– Saturation - purity of a color

∗ How much white is mixed with a pure color

– Lightness (brightness) - intensity

∗ Lightness pertains to reflected color

∗ Brightness pertains to emitted color

• Artists’ terminology

– These relate to pure pigments (pure colors)

– Tint

∗ Result of adding white to pigment

∗ Reduces saturation

– Shade

∗ Result of adding black to pigment

∗ Reduces lightness

– Tone

∗ Result of adding white and black to pigment

• Both terminologies widely used

– Both are subjective

• Want objective system for describing color

2

Page 3: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Primaries

• Represent using color wheel

• Additive primaries

– Apply to colors of light

– Primaries: RGB

– Secondaries: CMY

– Max combination of 3 primaries: white

– Absence of primaries: black

– Called additive because as add more primaries, are contributing more colorsto the light

∗ i.e., the more wavelengths are represented

• Subtractive

– Apply to colors of pigments

– Primaries: CMY

– Secondaries: RGB

– Max combination of 3 primaries: black

– Absence of primaries: white**

– Called subtractive because as add more primaries, are absorbing more colorsfrom the light

• Color space is set of colors that can be generated from a set of primaries

3

Page 4: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Light

• Characterized by wavelength (λ) and intensity

• Visible light λ in range [380, 700] nm

• Basic colors of spectrum: ROYGBIV

• Given color represented by a spectral (color distribution) curve

• Colorimetry: objective, quantitative science of color

• Objective characteristics of color

– Dominant wavelength - observed color (λ)

∗ Corresponds to hue

– Excitation purity - per cent of dominant λ

∗ Corresponds to saturation

– Luminance - intensity; total amount of energy

∗ Corresponds to lightness/brightness

4

Page 5: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Eye Structure

• Retina covered with 2 types of photoreceptors

1. Rods

– Sensitive to low-intensity light

– Overloaded by bright light

– Only useful for night vision

– Densest around perimeter of retina

– ∼ 120 million

5

Page 6: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Eye Structure (2)

2. Cones

– Only stimulated by bright light

– 3 types

∗ Usually referred to as R, G, B types

– ∼ 6 million

– Most dense in fovea - center of retina

∗ Only place where cone density > rod density

– Foveola - center of fovea

∗ 100% cones

∗ Greatest density of cones

∗ Part of eye most sensitive to color

∗ Has greatest visual acuity

• Trichromacy theory (3 channel, Young-Helmholtz theory)

– Eye has 3 color channels

6

Page 7: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Eye Response to Light

• Cones respond to light differently

– B cone most sensitive to 440 nm (indigo)

– G cone most sensitive to 545 nm (green)

– R cone most sensitive to 580 nm (greenish-yellow)

– Better labels are S, M, L for short, medium, and long λ sensitivity

• Rods most sensitive to 449 nm

• Comparatively, eye least sensitive to blue

– I.e., given R, G, B light of equal intensities, B will seem much dimmer

7

Page 8: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Eye Response to Light (2)

• Luminance efficiency function

– Shows eye’s response to light of equal intensities as a function of λ

– Peak sensitivity 550 nm

– Linear combination of 3 cone functions

8

Page 9: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Eye Response to Light (3)

• Functions rλ, gλ, bλ represent amounts of additive primaries needed to createperception of all colors of spectrum

– Negative values ⇒ cannot produce color from primaries

– Such colors only generated by adding the negative amount to color sample

– Hence, additive primaries cannot reproduce all colors of spectrum (wrt eye)

• Eye can distinguish ∼ 128 different fully saturated hues

– Proximity of each hue not linear wrt λ

• Eye’s response to brightness not linear

– Doubling intensity does not result in perception of doubled brightness

9

Page 10: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Tristimulus Theory

• Given spectral distribution P (λ) and sensitivity curve S(λ)

– Particular cone generates signal A = ∫ S(λ)P (λ)d(λ)

– Cone converts continuous distribution into a discrete value

– 3 discrete signals generated by eye: AR, AG, AB

• Perceived color can be represented as C = TRα + TBβ + TGγ

– α, β, γ are primaries, Ti are intensities of each

• Ti called tristimulus values

• Tristimulus theory states that can produce any color with the right tristimulusvalues

• Many:1 correspondence between tristimulus values and perceived color

– Several sets of TSVs can generate same color perception

– Such sets called metamers

– Implication: 2 spectral distributions may appear the same color

• Metamerism depends on light source, object, and viewer

– 2 objects may appear same color under one light, but different under an-other light

– One viewer may see 2 spectral distributions as same color, while anotherviewer sees the same distributions as different colors

10

Page 11: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

COLOR: CIE

• Commission Internationale de l’Eclairage (International Commission on Illu-mination)

• Founded in 1920’s

• Purpose is the study and standardization of color

– Intent is to provide objective description of color

• Responsible for a number of standards

– Standard illuminant - light source

∗ Defined in terms of black body radiators

· Ideal object that produces light solely via thermal energy

· Observed color only depends on light source

∗ Standards:

1. Illuminant A - tungsten lamp

2. Illuminant B - sunlight with correlated color temperature of 4874oK

3. Illuminant C - sunlight with correlated color temperature of 6774oK

4. Illuminants D - series of various daylight conditions

(a) D50 - sunlight with correlated color temperature of 5000oK

(b) D65 - sunlight with correlated color temperature of 6504oK

5. Illuminant E - equal energy illuminant

· Theoretical ideal

6. Illuminants F - series of various fluorescent lamps

– Standard observer

∗ Represents full tristimulus response of typical human

∗ Standards:

1. 2o observer (1931) - observes color swatches that subtend 2o FOV ofretina

· (Color concentrated on fovea)

2. 10o observer (1964) - observes color swatches that subtend 10o FOVof retina

11

Page 12: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

COLOR: CIE Color Systems

• Designed to provide 3 primaries that capture full range of visible light

• Replace RGB

• Systems:

1. XYZ

2. xyY

3. Lab

4. Luv

12

Page 13: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

COLOR: CIE XYZ System

• Primaries

– X, Y, Z

– Loosely correspond to R, G, B

– Do NOT require negative values to generate all colors

• Blending functions

– xλ, yλ, zλ

– Represent amount of X, Y, Z to generate all colors

– yλ chosen to be same as luminance function

– Defined for standard 2o observer

– xλ, yλ, zλ linear combinations of rλ, gλ, bλ

∗ Can convert between 2 systems

13

Page 14: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

COLOR: CIE XYZ System (2)

• XYZ space

– Given a spectral distribution P (λ), the amount of X needed to match thiscolor is X = k ∫ P (λ)xλdλ

– Similarly for Y, Z

– k defined by

∗ For emitters, k = 680 lumens/watt

∗ For reflectors, chosen so bright white has Y = 100

· Hence

k =100

∫ Pw(λ)yλdλ

· where Pw is spectral distribution of source used for white

– Visible part of XYZ space

∗ Curved surface represents X + Y + Z = 1 plane

– Color C = XX + YY + ZZ

14

Page 15: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CIE Chromaticity

• Chromaticity represents color info only

– Excludes luminance aspect (i.e., represents hue and saturation, but notlightness)

• Defined as

x =X

X + Y + Z

y =Y

X + Y + Z

z =Z

X + Y + Z

• x+ y + z = 1 and falls on X + Y + Z = 1 plane

• CIE chromaticity diagram

15

Page 16: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CIE Chromaticity (2)

– Projection of X + Y + Z = 1 onto X-Y plane represents all visible chro-maticity values

– All colors with same hue and saturation map to same point, regardless ofluminance

– Pure hues lie on perimeter

– Central dot represents illuminant C

• Given x, y

– z = 1− x− y– Not enough info to recover X, Y , Z

– Requires an additional value: Y

– XYZ recovered by

X =x

yY

Y = Y

Z =1− x− y

yY

• THE FOLLOWING MUST BE DISTINGUISHED:

– X, Y, Z represent the 3 CIE primaries

– xλ, yλ, zλ represent the functions that represent the amount of each CIEprimary needed to produce a given visible dominant wavelength

– X, Y, Z represent tristimulus values of the primaries

– x, y, z represent chromaticity values of a color

16

Page 17: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CIE Chromaticity Diagram Applications

• If 2 colors mixed, resultant color lies on straight line connecting them

• Finding dominant λ of color

– Measure XYZ tristimulus values

– Calculate xy chromaticity values

– Plot point on diagram

– Draw straight line thru point and white

– Point of intersection with perimeter is dominant hue

• Finding excitation purity of color

– Given: chromaticity values of color C and dominant hue H

ep =|CW ||HW |

• Finding complements

– Draw line thru color and white

– Complement is on line on opposite side of white

• Non-spectral colors

– Do not correspond to a visible hue

– Represent their dominant hue as a complement, represented λc

• Color gamuts

– Gamut is set of all possible colors that can be produced from a given set

– Gamut’s chromaticities represented by triangle defined by chromaticities ofprimaries

– No visible primaries capable of producing all visible colors

• Chromaticity diagram does not represent full palette

– Luminance values not represented

– Infinitely many planes in XYZ space, each with different luminosity, thatproject to chromaticity diagram

17

Page 18: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CIE Luv

• Consider

– C1 = (X1, Y1, Z1)

– D1 = C1 + ∆C, where ∆C = (∆X,∆Y,∆Z)

– C2 = (X2, Y2, Z2)

– D2 = C2 + ∆C

– In general, the perceived difference between C1 and D1 will not be the sameas the difference between C2 and D2

• A perceptually uniform color space is one in which 2 colors that are equallydistant from other colors will be perceived as having the same amount of dif-ference

• CIE Luv space designed to be uniform

– (Xn, Yn, Zn) defines white

– L∗ = 116( YYn )1/3 − 16

– Y/Yn > 0.01

– u∗ = 13L∗(u′ − u′n)– v∗ = 13L∗(v′ − v′n)– where

u′ =4X

X + 15Y + 3Z

v′ =4Y

X + 15Y + 3Z

u′n =4Xn

Xn + 15Yn + 3Zn

v′n =4Yn

Xn + 15Yn + 3Zn

18

Page 19: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Failures of Trichromacy Theory

• Fundamental colors

– RBY primaries do not correspond to standard primaries

– Y ”more basic” than G, M, C

• Anomalous pairs/opponency

– Some mixtures are not ”natural”: B-Y, R-G

– Color blindness tends to affect pairs:

∗ RG

∗ BY

– After images based on same pairs (see flag ex)

– Opponency (Herring) theory

∗ Retina consists of components that generate inhibiting signals, based onλ

∗ Components work as antagonistic pairs:

1. RG

2. BY

3. KW

To demonstrate, stare at the flag for 1 minute, then stare at the white areaunderneath.

19

Page 20: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: Failures of Trichromacy Theory (2)

• Zone theory

– Reconciles trichromacy and opponency

– 2 layers of retina

∗ First consists of trichromatic cones

∗ Second receives inhibitory and positive signals from first

• Context

20

Page 21: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: RGB Model

• Additive primaries

• Used for CRTs

• Color cube

– Plotted on Cartesian coordinate system

– Black at origin

– White at FUR corner

– Main diagonal represents grays

21

Page 22: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: RGB Model (2)

• To convert arbitrary RGB → CIE XYZ value

– Based on chromaticity values of monitor’s phosphors

– Use xyY values

– [1] X = XrR +XgG+XbB

∗ where Xr, Xg, Xb represent contribution of X by R, G, B phosphors

∗ Similarly for Y , Z

– To determine Xr, Xg, Xb

∗ Let Cr = Xr + Yr + Zr·

xr =Xr

Xr + Yr + Zr=Xr

Cr

· where xr is chromaticity value for red phosphor

∗ [2] Xr = xrCr∗ xr, yr available from CRT specs → zr = 1− xr − yr∗ Given Yr, Cr = Yr/yr (similarly for Yg, Yb)

∗ Thus

X =xrYryr

R +xgYgyg

G+xbYbyb

B

· (Substitution for Xr, etc. in [1], [2])

∗ (Similarly for Y , Z)

22

Page 23: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CMYK Model

• Subtractive primaries

• Used in hard-copy devices

• Each primary absorbs a specific additive primary

– e.g., C (B + G) subtracts R

• Can write as C = 1−R, M = 1−G, Y = 1−B,

• Color cube

– Inverse of RGB case

– White at origin

– Black at FUR corner

– Main diagonal represents grays

• Usually use black (K) as 4th primary

– Hard to produce true K with CMY

– Requires less ink (dries faster, less soggy paper)

23

Page 24: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: YIQ Model

• NTSC standard for TV color broadcast

• Y represents luminance info: same as CIE Y

• IQ represent chromaticity info

• Black and white TV only uses Y value

• Conversions:

– Y = 0.299R + 0.587G+ 0.114B

– I = 0.596R− 0.275G− 0.321B

– Q = 0.212R− 0.523G+ 0.311B

• Based on NTSC standard RGB phosphorsR G B

x 0.67 0.21 0.14y 0.33 0.71 0.08

where illuminant C has white point xw = 0.31, yw = 0.316, Yw = 100.0

• Encoding based on eye characteristics:

– Eye more sensitive to changes in luminance than to changes in saturation

∗ → Y more important than I or Q

– Objects that subtend a small FOV produce limited sensation

∗ → do not need same values for I and Q

∗ Since eye is less sensitive to B, use less bandwidth for it

– To maximize amount of info in signal, use

∗ 4Mz for Y

∗ 1.5 Mz for I

∗ 0.6Mz for Q

24

Page 25: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: HSV Model

• Based on artist concepts of tint, shade, tone

• Color cone

– Cylindrical coordinate system

– Vertical axis V (value) - represents lightness

– H (hue) measured as angle around V axis

∗ R at 0o

– S (saturation) measured as distance from V axis to edge

∗ Edge represents S = 1

– Apex of cone at origin

– Black at V = 0, S = 0

– White at V = 1, S = 0

– Pure colors at V = 1, S = 1

• Tints generated by decreasing S value

• Shades generated by decreasing V value

• Tones generated by decreasing S and V values

• Top plane of cone corresponds to looking down main diagonal of RGB colorcube

• Each plane of constant V corresponds to subcube of RGB space

25

Page 26: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: HLS Model

• Based on HLS space

• Pair of face-to-face cones

– L axis corresponds to V axis

– V = 1 corresponds to L = 0.5

– Black at L = 0, S = 0

– White at L = 1, S = 0

– L = 0.5 plane corresponds to V = 1 plane of HSV

– Pure colors at L = 0.5, S = 0

26

Page 27: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CRT Considerations/Limitations

• Color/frame buffer

– Buffer depth: Number of color bits

∗ Often represented as bit planes

· Have 1 plane for each bit

· Bits in a given cell collectively represent color for that pixel:

27

Page 28: Color: Introdjmoon/cg/cg-notes/cg-color.pdf{ Several sets of TSVs can generate same color perception { Such sets called metamers { Implication: 2 spectral distributions may appear

Color: CRT Considerations/Limitations (2)

• Color indexing

– Method to provide relatively rich palette when color buffer has limiteddepth

∗ Assume depth = k bits

– Pixel does not store color data (e.g., RGB), but an index to a color table(index)

∗ Color table is lookup table

∗ Has 2k entries

∗ Memory allocated per slot >>> k (e.g., 4m where m = 8 bits)

∗ Entries represent RGBA values

∗ If pixel value = p, pixel color is color table[p]

∗ Can represent 23m colors, but only 2k at any one time

– Adds level of indirection to color access

• Dithering

– Another means of providing more colors than may be available

– Generated by color pattern distributed over area

– Decreases resolution

28