CS 430 Computer Graphics Color Theory ChiCheng Lin

  • Slides: 37
Download presentation
CS 430 Computer Graphics Color Theory Chi-Cheng Lin, Winona State University

CS 430 Computer Graphics Color Theory Chi-Cheng Lin, Winona State University

Topics Colors l CIE Color Model l RGB Color Model l CMY Color Model

Topics Colors l CIE Color Model l RGB Color Model l CMY Color Model l YIQ Color Model l Intuitive Color Concepts l HSV Color Model l HLS Color Model l 2

l Colors z. A narrow frequency band within the electromagnetic spectrum 3

l Colors z. A narrow frequency band within the electromagnetic spectrum 3

Colors l Visible band z. Each frequency corresponds to a distinct color z. Low-frequency

Colors l Visible band z. Each frequency corresponds to a distinct color z. Low-frequency end (4. 3 x 1014 Hz): Red z. High-frequency end (7. 5 x 1014 Hz): Violet z. Wavelength = v/f, where v=300, 000 km/sec z. Low frequency High frequency red orange yellow green blue violet Long wavelength Short wavelength 700 nm 4

Colors l Colors of an object z. Light source emits “white light” (all frequencies

Colors l Colors of an object z. Light source emits “white light” (all frequencies of light) z. Object reflects/absorbs some frequencies z. Color = combination of frequencies reflected l Dominant wavelength (or frequency) z. Hue or color of the light z. E. g. , pink S( ): spectrum (luminance/intensity of light) 400 620 700 5

CIE Color Model l Color models z. Use three primary colors to produce other

CIE Color Model l Color models z. Use three primary colors to produce other colors l Primary colors z. Colors used in a color model to produce all the other colors in that model. z. Cannot be made from the other (two) colors defining the model. l CIE color model z. X, Y, and Z: nonexistent, super saturated colors y. Vectors in 3 -D additive color space z. Any color S = AX + BY + CZ 6

CIE Color Model l S = AX + BY + CZ can be normalized

CIE Color Model l S = AX + BY + CZ can be normalized to zx = A/(A+B+C) zy = B/(A+B+C) zz = C/(A+B+C) s = x. X + y. Y + z. Z, where x + y + z = 1 s lies in the plane x + y + z = 1 in 3 D y =670 x =400 z 7

CIE Color Model l CIE chromaticity diagram zs'( ) = (x( ), y( ))

CIE Color Model l CIE chromaticity diagram zs'( ) = (x( ), y( )) z. By viewing the 3 D curve in an orthographic projection, looking along the z-axis zhorseshoe shape y =670 x =400 z 8

CIE Chromaticity Diagram 9

CIE Chromaticity Diagram 9

CIE Chromaticity Diagram 10

CIE Chromaticity Diagram 10

Uses of CIE Chromaticity Diagram 11

Uses of CIE Chromaticity Diagram 11

Uses of CIE Chromaticity Diagram l Any colors on the line l between two

Uses of CIE Chromaticity Diagram l Any colors on the line l between two colors a and b z. Is a convex combination of a and b z. Is a legitimate color zcan be generated by shining various amounts of a and b onto a screen (like “tweening”) l Complementary colors z. Any two colors on a line passing through white and added up to be white are complementary e. g. , e and f zred cyan green magenta blue yellow 12

Uses of CIE Chromaticity Diagram l Measure dominant wavelength and saturation z. Color g:

Uses of CIE Chromaticity Diagram l Measure dominant wavelength and saturation z. Color g: Some combination of h and white z. Dominant wavelength of g = wavelength at h z. Saturation (purity) of g = (g - w) / (h - w) l Color j has no dominant wavelength because k is not a pure color (k lies on the purple line) z. Represented by dominant wavelength of k’s complement m, with by a c suffix, e. g. , 498 c 13

Uses of CIE Chromaticity Diagram l Any color within a triangle can be generated

Uses of CIE Chromaticity Diagram l Any color within a triangle can be generated by the three vertices of the triangle z. Any point inside IJK is a convex combination of points I, J, and K 14

Uses of CIE Chromaticity Diagram l Define color gamuts z. Range of colors that

Uses of CIE Chromaticity Diagram l Define color gamuts z. Range of colors that can be produced on a device CRT monitor’s gamut is different from printer’s (See Plate 33 in the textbook) l Any choice of three primaries can never encompass all visible colors l RGB are natural choices for primaries as they can cover the largest part of the “horseshoe” l 15

Gamut Example 16

Gamut Example 16

RGB Color Model l Used in light emitting devices z. Color CRT monitors l

RGB Color Model l Used in light emitting devices z. Color CRT monitors l Additive z. Result = individual contributions of each primary color added together z. C = r. R + g. G + b. B, where r, g, b [0, 1] z. R = (1, 0, 0) z. G = (0, 1, 0) z. B = (0, 0, 1) 17

RGB Color Model 18

RGB Color Model 18

RGB Color Model l Color Cube z. R + G = (1, 0, 0)

RGB Color Model l Color Cube z. R + G = (1, 0, 0) + (0, 1, 0) = (1, 1, 0) = Y z. R + B = (1, 0, 0) + (0, 0, 1) = (1, 0, 1) = M z. B + G = (0, 0, 1) + (0, 1, 0) = (0, 1, 1) = C z. R + G + B = (1, 1, 1) = W z 1 – W = (0, 0, 0) = BLK z. Grays = (x, x, x), where x (0, 1) 19

Color Cube 20

Color Cube 20

CMY Color Model CMY: Complements of RGB l Used in light absorbing devices l

CMY Color Model CMY: Complements of RGB l Used in light absorbing devices l z. Hardcopy output devices l Subtractive z. Color specified by what is subtracted from white light z. Cyan absorbs red, magenta absorbs green, and yellow absorbs blue 21

CMY Color Model 22

CMY Color Model 22

CMY Color Model l W = (0, 0, 0) B = (1, 1, 1)

CMY Color Model l W = (0, 0, 0) B = (1, 1, 1) l Conversion from RGB to CMY l Conversion from CMY to RGB 23

CMYK Color Model l Motivations z. Do we get black if paint cyan, magenta

CMYK Color Model l Motivations z. Do we get black if paint cyan, magenta and yellow on a white paper? z. Which cartridge is more expensive? l CMYK model z. K = greatest gray that can be extracted l Given C, M, and Y z. K = min(C, M, Y) z. C = C – K z. M = M – K z. Y = Y – K Try some examples… 24

YIQ Color Model l Used in U. S. commercial color-TV broadcasting z. Recoding of

YIQ Color Model l Used in U. S. commercial color-TV broadcasting z. Recoding of RGB for transmission efficiency z. Backward compatible with black-and-white TV z. Transmitted using NTSC (National Television System Committee) standard 25

YIQ Color Model l YIQ z. Y: luminance z. I, Q: chromaticity z. Only

YIQ Color Model l YIQ z. Y: luminance z. I, Q: chromaticity z. Only Y shown in black-and-white TV l RGB YIQ 26

YIQ Color Model l Human’s visual properties z. More sensitive to changes in luminance

YIQ Color Model l Human’s visual properties z. More sensitive to changes in luminance than in hue or saturation more bits should be used to represent Y than I and Q z. Limited color sensation to objects covering extremely small part of our field of view One, rather than two color dimensions would be adequate I or Q can have a lower bandwidth than the others 27

YIQ Color Model l NTSC encoding of YIQ into broadcast signal z. Uses human’s

YIQ Color Model l NTSC encoding of YIQ into broadcast signal z. Uses human’s visual system properties to maximize information transmitted in a fixed bandwidth z. Y: 4 MHz z. I: 1. 5 MHz z. Q: 0. 6 MHz 28

Intuitive Color Concepts l Terminology Perceptual Term hue Colorimetry Comments dominated wavelength saturation excitation

Intuitive Color Concepts l Terminology Perceptual Term hue Colorimetry Comments dominated wavelength saturation excitation purity Lightness (reflecting luminance objects) Brightness (selfluminance luminous objects) to distinguish colors e. g. , red and pink e. g. , Sun, CRT 29

Intuitive Color Concepts white grays tints pure color tones shades black z. Tint: white

Intuitive Color Concepts white grays tints pure color tones shades black z. Tint: white pigment added to pure pigment saturation reduced z. Shade: black pigment added to pure pigment lightness reduced z. Tone: consequence of adding both white and black pigments to pure pigments 30

Intuitive Color Concepts Tints, shades, and tones different colors of same hue are produced

Intuitive Color Concepts Tints, shades, and tones different colors of same hue are produced l Grays = black pigments + white pigments l Graphics packages that provide color palettes to users often employ two or more color models l 31

HSV Color Model l HSV = Hue, Saturation, and Value z. A. k. a.

HSV Color Model l HSV = Hue, Saturation, and Value z. A. k. a. HSB, where B is Brightness RGB, CMY, and YIQ: hardware-oriented l HSV and HLS: user-oriented l Cylinder coordinate system l z. Space: hexcone zhexagon is obtained from the color cube in isometric projection z(h, s, v), where h [0, 360) and s, v [0, 1] yhue: angle round the hexagon ysaturation: distance from the center yvalue: axis through the center 32

HSV Color Model Color Cube Hexcone 33

HSV Color Model Color Cube Hexcone 33

HSV Color Model W = (-, 0, 1) l B = (-, 0, 0)

HSV Color Model W = (-, 0, 1) l B = (-, 0, 0) l R = (0, 1, 1) Y = (60, 1, 1) l : M = (300, 1, 1) l Adding white pigments S l Adding black pigments V l Creating tones S and V 34

HSV Color Model True color system: 16 million colors l Q: Do we need

HSV Color Model True color system: 16 million colors l Q: Do we need that many? l Human eyes can distinguish l z 128 hues z 130 tints (saturation levels) z 23 shades of yellow colors, 16 of blue colors 128 x 130 x 23 = 82720 colors 35

HLS Color Model HLS: Hue, Lightness, and Saturation l Cylinder coordinate system l z.

HLS Color Model HLS: Hue, Lightness, and Saturation l Cylinder coordinate system l z. Space: double cone zbase is from the hexagon as in HSV z(h, l, s), where h [0, 360) and s, v [0, 1] yhue: angle round the base ylightness: axis through the center ysaturation: distance from the center W = (-, 0, 1) l B = (-, 0, 0) l R = (0, 0. 5, 1), Y = (60, 0. 5, 1), … l 36

HLS Color Model l Double cones white pure color h black 37

HLS Color Model l Double cones white pure color h black 37