Color Representation. Foley & Van Dam, Chapter 13

Color Representation Foley & Van Dam, Chapter 13 Color Representation • Visible Light Spectrum • Color Matching • Trichromatic Color Theory • Psycho...
Author: Edgar Daniel
4 downloads 0 Views 682KB Size
Color Representation Foley & Van Dam, Chapter 13

Color Representation • Visible Light Spectrum • Color Matching • Trichromatic Color Theory • Psychophysics • CIE standard • RGB and CMYK Color Spaces • HLS Color Model • YIQ Color Model

Visible Light Spectrum and Colors Light is an electro-magnetic radiation Gamma

10

X rays

-12

Ultraviolet

10

Infrared

-8

10

Radar

-4

FM

ShortTV wave

AM

4

1 10 Wavelength in meters (m)

AC electricity

10

Visible light

400 nm

500 nm

600 nm

700 nm

Wavelength in nanometers (1nm=10-9 m)

• Hue: distinguished among colors • Saturation: how far is color from a gray of equal intensity • Lightness: perceived intensity of a reflective surface • Brightness: perceived intensity of emitting surface

8

Spectral Power Distribution • The Spectral Power Distribution of a light is a function f(λ) defining the energy at each wavelength 1

1

0.5

0.5

0

400

500

600

700

0

Blue Skylight 1

0.5

0.5

400

500

600

500

600

700

Tungsten bulb

1

0

400

700

Red monitor phosphor

0

400

500

600

Monochromatic light

700

Color Matching Experiment • Three primary lights are set to match a test light • Metamer: two lights visually undistinguishable (they might have different spectral power distributions) test

match

+ + -

Power

+ -

0

Test light (tungsten light)

400

500

Match light (monitor emission)

~ = 600

700

0

400

500

600

700

Trichromatic Color Theory • Trichromatic: “tri”=three “chroma”=color also tristimulus color vision is based on three primaries (three dimensional) •Thomas Young • A few different retinal receptors operating with different wavelength sensitivities allow humans to perceive colors • Suggested 3 receptors • Helmholtz & Maxwell • Color matching with 3 primaries

The Human Eye Lens Cornea Pupil Iris

Fovea

Optic Nerve

rods

Vitreous Humor Optic Disc

cones

Retina Ocular Muscle

horizontal amacrine

bipolar ganglion light

Retinal Photoreceptors

Relative sensitivity

• Cones: Sensitive to high illumination levels (Photopic vision) Less sensitive than rods 5 million cones in each eye Only cones in fovea (approx. 50,000) Density decreases with distance from fovea 3 types differing in their spectral sensitivity: L , M, and S 1

L M S

0.75 0.5 0.25 0

400

500

600

Wavelength (nm)

700

Retinal Photoreceptors

Linear Color Spaces • Colors in 3D color space can be described as linear combinations of 3 basis colors called primaries

= A•

+ B•

+ C•

The representation of the color having spectrum:

Is given by (A, B, C)

Choosing The Primaries

Primary Intensity

• Stiles & Burch (1959) used 3 monochromatic primaries of wavelengths 444.4, 525.3 and 645.2 3

r(λ)

2 1

b(λ)

g(λ)

0 400

500

600

Wavelength (nm)

Color Matching Diagram Problem: Subtractive components

700

CIE Color Standard • CIE: Commision Internationale d’Eclairage (1931) defined a standard system (CIE- XYZ) for color representation

Tristimulus values

1.8 1.4

z(λ) y(λ)

1

x(λ)

0.6 0.2 400

500

600

Wavelength (nm)

700

• Weights are non negative over the visible wavelengths • The 3 primaries associated with x y z color matching functions cannot be easily realized in hardware • y was chosen to equal luminance of monochromatic lights

CIE Color Standard If X, Y and Z are the weights used to define a color C, then the chromaticity values x, y, z (independent from the luminosity) are given by: x= X/(X+Y+Z) y=Y/(X+Y+Z) z=Z/(X+Y+Z) (x,y,z) is a point on the plane X+Y+Z=1

Y

0.9

520

510

y

505 500

0.5

530

540

550 570

495 490 485 480 470 450 0.0

0.0

X

560 580 590

600 610 650

Z

CIE Chromaticity Diagram

x 0.5

1.0

CIE Color Standard • Color Gamut: A convex sum of several colors

RGB Color Representation Cathode (electron gun)

shadow mask and phosphor coated screen

electron guns shadow mask

focusing anode deflection yoke

phosphors on glass screen

• In a CRT each color can be defined by the required power of each electron gun:

C = rR + gG + bB • The intensity is defined as:

I = r + g + b

•The chroma(ticy) is defined as: rR + gG + bB C = r + g + b

RGB Color Images 10 200 111 17 200 36 12 36 17 14 17 14 126 200 17 36 72 12

126 36 12 36 36 111 36 12 17 111 200 36 1712 111 36 200 14 3636 12 36 200 1111414 361261217 3611114 36 10 1283612636200 12 36111 36 17 111 17111 111 1414 126 17 36 1736 126 14 72200 126 17 3611112 36 127236 126 1263617 121113620012 126 12 17 200 17 14 36 14 2007236 1212 17126111 126 200 111 14 36 72 36 12 17 72 106 155 111 14

white blue

green

red

black

128 36 14 36 111 111 17 36 111 200 126 36 200 36 111 12 12 126

126 12 126 36 14 36 126 111 200 36 72 12 111 12 14 17 17 200

200 36 36 14 126 12 17 36 36 12 126 36 14 36 126 72 111 36

12 12 36 17 111 12 126 14 36 17 106 12

14 17 14 17 12 14

111 36 72 111 200 36 17 36 72 111 155 36

36 111 36 111 126 36

RGB to CIE-XYZ Conversion • RGB to CIE-XYZ is a linear transformation:  2 .3 6 5  − 0 .8 9 7   − 0 .4 6 8

− 0 .5 1 5 1 .4 2 6 0 .0 8 9

0 .0 0 5  − 0 .0 1 4  1 .0 0 9 

R G   B

 X   = Y       Z 

• R = monochromatic primary 700nm • G = monochromatic primary 546.1nm • B = monochromatic primary 435.8nm

RGB vs. CMY(K) Color Scheme • RGB and CMYK (Cyan, Magenta, Yellow and blacK) are hardware-oriented representations • CMY is used in color photography and (with K) in most color printers C M   Y

RGB is Additive

CMY is Subtractive

 1   R   = 1  −  G         1   B 

The HLS Color Model • HLS: Hue Lightness, Saturation similar to HSV: Hue Saturation Value

Munsell Book of Colors

Hue (red, green, yellow, blue ...) Saturation (pink, bright red, ....) Lightness (black, grey, white ....)

The YIQ Color Model • Based on the concept of opponent colors • Used in NTSC Television (National Television Systems Committee) • Similar method (YCbCr) used in JPEG and MPEG  0 .2 9 9  0 .5 9 6   0 .2 1 2

0 .5 8 7 − 0 .2 7 5 − 0 .5 2 3

• Y = Luminance • I = Red-Green • Q = Blue-Yellow

0 .1 1 4  − 0 .3 2 1  0 .3 1 1 

R G   B

 Y   = I       Q 

+ -

+ -

The YIQ Color Model • The human eye is more sensitive to luminosity than to colors, so it is possible to save space by encoding colors more coarsely • Preferred by the NTSC because of backward compatibility with B/W TV

Original

Y - Blur

I - Blur

Q - Blur

Summary • CIE-XYZ • Tristimulus Coordinates • Device Independent • Universal standard • CIE-Lab • Perceptual Space, used to assess image quality • RGB and CMY • Hardware oriented • Additive spaces used for CRT, printers, photography • YIQ and YCbCr • Opponent Space • Used for color television broadcast and image compression • HLS • Perceptual Digitized Space • Used for Human Interactive Painting