document18

20
David Luebke 1 06/26/22 Color CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003

Upload: dominic54

Post on 13-Jan-2015

279 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Document18

David Luebke 1 04/10/23

Color

CS 445/645Introduction to Computer Graphics

David Luebke, Spring 2003

Page 2: Document18

David Luebke 2 04/10/23

Color

● Next topic: Color

To understand how to make realistic images, we need a basic understanding of the physics and physiology of vision. Here we step away from the code and math for a bit to talk about basic principles.

Page 3: Document18

David Luebke 3 04/10/23

Basics Of Color

● Elements of color:

Page 4: Document18

David Luebke 4 04/10/23

Basics of Color

● Physics: ■ Illumination

○ Electromagnetic spectra

■ Reflection○ Material properties (i.e., conductance) ○ Surface geometry and microgeometry (i.e., polished versus matte

versus brushed)

● Perception■ Physiology and neurophysiology■ Perceptual psychology

Page 5: Document18

Physiology of Vision

● The eye:● The retina

■ Rods■ Cones

○ Color!

Page 6: Document18

David Luebke 6 04/10/23

Physiology of Vision

● The center of the retina is a densely packed region called the fovea. ■ Cones much denser here than the periphery

Page 7: Document18

David Luebke 7 04/10/23

Physiology of Vision: Cones

● Three types of cones:■ L or R, most sensitive to red light (610 nm) ■ M or G, most sensitive to green light (560 nm)■ S or B, most sensitive to blue light (430 nm)

■ Color blindness results from missing cone type(s)

Page 8: Document18

Physiology of Vision: The Retina

● Weirdly, rods and cones are at the back of the retina, behind a mostly-transparent neural structure that collects their response.

Page 9: Document18

David Luebke 9 04/10/23

Perception: Metamers

● A given perceptual sensation of color derives from the stimulus of all three cone types

● Identical perceptions of color can thus be caused by very different spectra

Page 10: Document18

David Luebke 10 04/10/23

Perception: Other Gotchas

● Color perception is also difficult because:■ It varies from person to person (thus std observers)■ It is affected by adaptation ■ It is affected by surrounding color:

Page 11: Document18

David Luebke 11 04/10/23

Color Spaces

● Three types of cones suggests color is a 3D quantity. How to define 3D color space?

● Idea: shine given wavelength () on a screen, and mix three other wavelengths (R,G,B) on same screen. Have user adjust intensity of RGB until colors are identical:

● How closely does this correspond to a color CRT?

● Problem: sometimes need to “subtract” R to match

Page 12: Document18

David Luebke 12 04/10/23

CIE Color Space

● The CIE (Commission Internationale d’Eclairage) came up with three hypothetical lights X, Y, and Z with these spectra:

● Idea: any wavelength can be matched perceptually by positive combinations of X,Y,Z

● Note that:X ~ R

Y ~ G

Z ~ B

Page 13: Document18

David Luebke 13 04/10/23

CIE Color Space

● The gamut of all colors perceivable is thus a three-dimensional shape in X,Y,Z:

● For simplicity, we often project to the 2D plane X+Y+Z=1X = X / (X+Y+Z)

Y = Y / (X+Y+Z)

Z = 1 - X - Y

Page 14: Document18

CIE Chromaticity Diagram (1931)

Page 15: Document18

David Luebke 15 04/10/23

Device Color Gamuts

● Since X, Y, and Z are hypothetical light sources, no real device can produce the entire gamut of perceivable color

● Example: CRT monitor

Page 16: Document18

David Luebke 16 04/10/23

Device Color Gamuts

● The RGB color cube sits within CIE color space something like this:

Page 17: Document18

David Luebke 17 04/10/23

Device Color Gamuts

● We can use the CIE chromaticity diagram to compare the gamuts of various devices:

● Note, for example, that a color printercannot reproduceall shades availableon a color monitor

Page 18: Document18

David Luebke 18 04/10/23

Converting Color Spaces

● Simple matrix operation:

● The transformation C2 = M-12 M1 C1 yields RGB on

monitor 2 that is equivalent to a given RGB on monitor 1

B

G

R

ZZZ

YYY

XXX

B

G

R

BGR

BGR

BGR

'

'

'

Page 19: Document18

David Luebke 19 04/10/23

Converting Color Spaces

● Converting between color models can also be expressed as such a matrix transform:

● YIQ is the color model used for color TV in America. Y is luminance, I & Q are color■ Note: Y is the same as CIE’s Y ■ Result: backwards compatibility with B/W TV!

B

G

R

Q

I

Y

31.052.021.0

32.028.060.0

11.059.030.0

Page 20: Document18

David Luebke 20 04/10/23

Gamma Correction

● We generally assume colors are linear● But most display devices are inherently nonlinear

■ I.e., brightness(voltage) != 2*brightness(voltage/2)

● Common solution: gamma correction■ Post-transformation on RGB values to map them to linear

range on display device:■ Can have separate for R, G, B

1

xy