# Intensities and Color

Intensities and Color

Intensities and Color

Department of Computer Science &

Institute of Multimedia Engineering

Rich Riesenfeld’s CG Slides, I-Chen Lin’s CG slides,

Shirley, Fundamentals of Computer Graphics, Chap 3.2-3.4, 20.1-4

Human Perception and Monitor Intensities

•Human perception of intensity is nonlinear

•Monitors are nonlinear with respect to input

•Non-zero intensities when screen is off

•Discrete intensities

DCP4516 Introduction to Computer Graphics 2

Gamma Correction

•Monitors are nonlinear with respect to input

•Images look too dark/bright

DCP4516 Introduction to Computer Graphics 3

http://graphics.stanford.edu/gamma.html

Gamma Correction

•Adjust intensities based on an approximate

nonlinear model:

input intensity

displayed intensity = ( max intensity ) a γ

gamma

•Gamma correct input

a'

a

1

DCP4516 Introduction to Computer Graphics 4

How to Determine Gamma

•Adjust input intensity of grey pixels until the

intensities of checkerboard pixels are halfway

between black and white

0.5 a

ln 0.5

ln a

DCP4516 Introduction to Computer Graphics 5

Three-Color Theory

•Human visual system has two types

of sensors

–Rods: monochromatic, night vision

–Cones

Color sensitive

•Three types of cones

•Only three values (the tristimulus values)

are sent to the brain

•Need only match these three values

•Need only three primary colors

DCP4516 Introduction to Computer Graphics 6

Wavelength Spectrum

infrared

light

ultraviolet

light

700 600 500 400

Wavelength (nm)

•Seen in physics, physical phenomena

(rainbows, prisms, etc)

•1 Dimensional color space

DCP4516 Introduction to Computer Graphics 7

Color Receptors in Eye

Fraction of light absorbed

by each type of cone

0.20

0 .18

0 .16

0 .14

0 .12

0 .1 0

0 .08

0 .06

0 .04

0 .02

0 .00

400 440 480 520 560 600 640 680

Wavelength λ(nm)

•(Red,

Green,

Blue)

•(Long,

Medium,

Short)

DCP4516 Introduction to Computer Graphics 8

Color Receptors in Eye

1.0

Relative sensitivity

0.0

400 450 500 550 600 650 700

Wavelength λ(nm)

DCP4516 Introduction to Computer Graphics 9

Color Space

Color is complicated!

–Highly nonlinear; No single model to explain all

•“Navigating,”moving around in a color space,

is tricky

•Many color representations (spaces)

•Can you get to a nearby color

•Can you predictably adjust a color

DCP4516 Introduction to Computer Graphics 10

Color Space (cont.)

•rgb

•cmy

•cmyk

•hsv

Perceptually Based:

•XYZ (Tristimulus)

•CIE

DCP4516 Introduction to Computer Graphics 11

•Form a color by adding amounts of three

primaries: Red (R), Green (G), Blue (B)

•CRTs, projection systems, positive film

DCP4516 Introduction to Computer Graphics 12

CMY Color Space: Subtractive Color

•Form a color by filtering white light with:

–Cyan (C), Magenta (M), and Yellow (Y) filters

–Printing, Negative film

R + G = Y

G + B = C

B + R = M

Y = W - B

C = W - R

M = W - G

DCP4516 Introduction to Computer Graphics 13

Color Cube

blue

(0,0,1 )

cyan

(0,1,1)

magenta

(1,0,1)

white

(1,1,1)

gray

black

(0,0,0)

green

(0,1,0)

red

(1,0,0)

DCP4516 Introduction to Computer Graphics 14

yellow

(1,1,0)

Color Cube

blue

magenta

(1,0,1)

blue (0,0,1 )

white

(1,1,1)

cyan

(0,1,1)

red

(1,0,0)

yellow

(1,1,0)

green

(0,1,0)

DCP4516 Introduction to Computer Graphics 15

Complementary Colors

•Looking at color cube along major diagonal

DCP4516 Introduction to Computer Graphics 16

blue

magenta

(1,0,1)

blue (0,0,1 )

white

(1,1,1)

cyan

(0,1,1)

red

(1,0,0)

yellow

(1,1,0)

green

(0,1,0)

DCP4516 Introduction to Computer Graphics 17

HSV Color Space

•Introduced by Albet Munsell, late 1800s

–He was an artist and scientist

•Hue: Color

•Saturation: strength of a color

–Neutral gray has 0 saturation

•Value: Intensity of light emanating from

image

DCP4516 Introduction to Computer Graphics 18

HSV Color Space

120˚

green

V

yellow

cyan

1.0

red

blue

240˚

magenta

black

0.0

H

S

DCP4516 Introduction to Computer Graphics 19

CIE* Color Space

•CIE primaries ( X, Y, Z )

–used to match, with only positive weights, all

visible colors

–represents the human color response for three

imaginary lights

•CIE color space defines the normalized coordinates:

x = X / ( X + Y + Z )

y = Y / ( X + Y + Z )

z = Z / ( X + Y + Z )

which factor out luminance and concentrate on color

*Commission Internationale de l'Êclairage

DCP4516 Introduction to Computer Graphics 20

CIE Color Space of Visible Colors

x = X / ( X + Y + Z )

y = Y / ( X + Y + Z )

z = Z / ( X + Y + Z )

y

x + y + z = 1

x

z

The projection of the plane of the triangle onto the (X,Y)

plane forms the chromaticity diagram that follows.

DCP4516 Introduction to Computer Graphics 21

Color Gamuts: CIE Color Chart

1.0

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

y

520

540

510

green

500

yellow

cyan

white

490

blue

red

magenta

400

560

580

600

700

1.0 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

x

DCP4516 Introduction to Computer Graphics 22

Color Gamuts: CIE Color Chart

5 1 0

5 20

5 4 0

5 6 0

5 0 0

58 0

6 0 0

4 9 0

70 0

4 0 0

http://www.cs.rit.edu/~ncs/color/a_chroma.html

DCP4516 Introduction to Computer Graphics 23

Compositing

•Frame buffer

–Simple color model: R, G, B; 8 bits each

–-channel A, another 8 bits

•Alpha determines opacity, pixel-by-pixel

–= 1: opaque

–= 0: transparent

•Blend translucent objects during rendering