Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color.

Similar presentations


Presentation on theme: "CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color."— Presentation transcript:

1 CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color

2 Assignment 3 Due March 23 Fourth years plan for thesis collisionFourth years plan for thesis collision We’ll provide lots of details to keep the assignment doableWe’ll provide lots of details to keep the assignment doable Morphing algorithm Due March 23 Fourth years plan for thesis collisionFourth years plan for thesis collision We’ll provide lots of details to keep the assignment doableWe’ll provide lots of details to keep the assignment doable Morphing algorithm

3 Last Class We discussed vision physiology and perception of gradients Today: Color perception Color representations We discussed vision physiology and perception of gradients Today: Color perception Color representations

4 Halftoning A technique used in newspaper printing Only two intensities are possible, blob of ink and no blob of ink But, the size of the blob can be varied Also, the dither patterns of small dots can be used A technique used in newspaper printing Only two intensities are possible, blob of ink and no blob of ink But, the size of the blob can be varied Also, the dither patterns of small dots can be used

5 Halftoning

6 Halftoning – dot size

7 Halftoning – Moire Patterns Repeated use of same dot pattern for particular shade results in repeated pattern Perceived as a moire patternPerceived as a moire pattern Instead, randomize halftone patternInstead, randomize halftone pattern Repeated use of same dot pattern for particular shade results in repeated pattern Perceived as a moire patternPerceived as a moire pattern Instead, randomize halftone patternInstead, randomize halftone pattern

8 Dithering Halftoning for color images

9 Specifying Color Color perception usually involves three quantities: Hue: Distinguishes between colors like red, green, blue, etcHue: Distinguishes between colors like red, green, blue, etc Saturation: How far the color is from a gray of equal intensitySaturation: How far the color is from a gray of equal intensity Lightness: The perceived intensity of a reflecting objectLightness: The perceived intensity of a reflecting object Sometimes lightness is called brightness if the object is emitting light instead of reflecting it. In order to use color precisely in computer graphics, we need to be able to specify and measure colors. Color perception usually involves three quantities: Hue: Distinguishes between colors like red, green, blue, etcHue: Distinguishes between colors like red, green, blue, etc Saturation: How far the color is from a gray of equal intensitySaturation: How far the color is from a gray of equal intensity Lightness: The perceived intensity of a reflecting objectLightness: The perceived intensity of a reflecting object Sometimes lightness is called brightness if the object is emitting light instead of reflecting it. In order to use color precisely in computer graphics, we need to be able to specify and measure colors.

10 Combining Colors Additive (RGB) Shining colored lights on a white ball Subtractive (CMYK) Mixing paint colors and illuminating with white light

11 How Do Artists Do It? Artists often specify color as tints, shades, and tones of saturated (pure) pigments Tint: Gotten by adding white to a pure pigment, decreasing saturationTint: Gotten by adding white to a pure pigment, decreasing saturation Shade: Gotten by adding black to a pure pigment, decreasing lightnessShade: Gotten by adding black to a pure pigment, decreasing lightness Tone: Gotten by adding white and black to a pure pigmentTone: Gotten by adding white and black to a pure pigment Artists often specify color as tints, shades, and tones of saturated (pure) pigments Tint: Gotten by adding white to a pure pigment, decreasing saturationTint: Gotten by adding white to a pure pigment, decreasing saturation Shade: Gotten by adding black to a pure pigment, decreasing lightnessShade: Gotten by adding black to a pure pigment, decreasing lightness Tone: Gotten by adding white and black to a pure pigmentTone: Gotten by adding white and black to a pure pigment White Pure Color Black Grays Tints Shades Tones

12 HSV Color Space Computer scientists frequently use an intuitive color space that corresponds to tint, shade, and tone: Hue - The color we see (red, green, purple)Hue - The color we see (red, green, purple) Saturation - How far is the color from gray (pink is less saturated than red, sky blue is less saturated than royal blue)Saturation - How far is the color from gray (pink is less saturated than red, sky blue is less saturated than royal blue) Brightness (Luminance) - How bright is the color (how bright are the lights illuminating the object?)Brightness (Luminance) - How bright is the color (how bright are the lights illuminating the object?) Computer scientists frequently use an intuitive color space that corresponds to tint, shade, and tone: Hue - The color we see (red, green, purple)Hue - The color we see (red, green, purple) Saturation - How far is the color from gray (pink is less saturated than red, sky blue is less saturated than royal blue)Saturation - How far is the color from gray (pink is less saturated than red, sky blue is less saturated than royal blue) Brightness (Luminance) - How bright is the color (how bright are the lights illuminating the object?)Brightness (Luminance) - How bright is the color (how bright are the lights illuminating the object?)

13 HSV Color Model Hue (H) is the angle around the vertical axis Saturation (S) is a value from 0 to 1 indicating how far from the vertical axis the color lies Value (V) is the height of the hexcone”

14 HSV Color Model Figure 15.16&15.17 from H&B H S V Color Red Green Blue *0.01.0White *0.00.5Gray * *0.0Black ? ? ?

15 Intuitive Color Spaces A top-down view of hexcone

16 HSV Color Space A more intuitive color space H = HueH = Hue S = SaturationS = Saturation V = Value (or brightness)V = Value (or brightness) A more intuitive color space H = HueH = Hue S = SaturationS = Saturation V = Value (or brightness)V = Value (or brightness) Value Saturation Hue

17 Precise Color Specifications Pigment-mixing is subjective --- depends on human observer, surrounding colors, lighting of the environment, etcPigment-mixing is subjective --- depends on human observer, surrounding colors, lighting of the environment, etc We need an objective color specificationWe need an objective color specification Light is electromagnetic energy in the 400 to 700 nm wavelength rangeLight is electromagnetic energy in the 400 to 700 nm wavelength range Dominant wavelength is the wavelength of the color we “see”Dominant wavelength is the wavelength of the color we “see” Excitation purity is the proportion of pure colored light to white lightExcitation purity is the proportion of pure colored light to white light Luminance is the amount (or intensity) of the lightLuminance is the amount (or intensity) of the light Pigment-mixing is subjective --- depends on human observer, surrounding colors, lighting of the environment, etcPigment-mixing is subjective --- depends on human observer, surrounding colors, lighting of the environment, etc We need an objective color specificationWe need an objective color specification Light is electromagnetic energy in the 400 to 700 nm wavelength rangeLight is electromagnetic energy in the 400 to 700 nm wavelength range Dominant wavelength is the wavelength of the color we “see”Dominant wavelength is the wavelength of the color we “see” Excitation purity is the proportion of pure colored light to white lightExcitation purity is the proportion of pure colored light to white light Luminance is the amount (or intensity) of the lightLuminance is the amount (or intensity) of the light

18 Electromagnetic Spectrum Visible light frequencies range between... Red = 4.3 x hertz (700nm)Red = 4.3 x hertz (700nm) Violet = 7.5 x hertz (400nm)Violet = 7.5 x hertz (400nm) Visible light frequencies range between... Red = 4.3 x hertz (700nm)Red = 4.3 x hertz (700nm) Violet = 7.5 x hertz (400nm)Violet = 7.5 x hertz (400nm) Figures 15.1 from H&B

19 Visible Light Hue = dominant frequency (highest peak) Saturation = excitation purity (ratio of highest to rest) Lightness = luminance (area under curve) Hue = dominant frequency (highest peak) Saturation = excitation purity (ratio of highest to rest) Lightness = luminance (area under curve) White Light Orange Light Figures from H&B

20 How well do we see color? What color do we see the best? Yellow-green at 550 nmYellow-green at 550 nm What color do we see the worst? Blue at 440 nmBlue at 440 nm Flashback: Colortables (colormaps) for color storage Which RGB value gets the most bits?Which RGB value gets the most bits? Can perceive color differences of 10 nm at extremes (violet and red) and 2 nm between blue and yellow Metamers – different energy radiations look like the same color Color perception also affected by surrounding light and adaptation What color do we see the best? Yellow-green at 550 nmYellow-green at 550 nm What color do we see the worst? Blue at 440 nmBlue at 440 nm Flashback: Colortables (colormaps) for color storage Which RGB value gets the most bits?Which RGB value gets the most bits? Can perceive color differences of 10 nm at extremes (violet and red) and 2 nm between blue and yellow Metamers – different energy radiations look like the same color Color perception also affected by surrounding light and adaptation

21 Just noticeable difference (JND) 128 fully saturated hues can be distinguished Cannot perceive hue differences with less saturated light. Sensitivity to changes in saturation for a fixed hue and brightness ranges from 16 to 23 depending on hue. Talked about representing intensities last lecture 128 fully saturated hues can be distinguished Cannot perceive hue differences with less saturated light. Sensitivity to changes in saturation for a fixed hue and brightness ranges from 16 to 23 depending on hue. Talked about representing intensities last lecture

22 Human Color Vision Humans have 3 light sensitive pigments in their cones, called L, M, and S Each has a different spectral response curve: This leads to metamerism “Tristimulus” color theory Humans have 3 light sensitive pigments in their cones, called L, M, and S Each has a different spectral response curve: This leads to metamerism “Tristimulus” color theory

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 screenShine given wavelength ( ) on a screen User must control three lasers producing three wavelengths (say R=700nm, G=546nm, and B=436nm)User must control three lasers producing three wavelengths (say R=700nm, G=546nm, and B=436nm) Adjust intensity of RGB until colors are identical Adjust intensity of RGB until colors are identical Note phosphors of TV are not perfect RGB emitters as the results to right demonstrateNote phosphors of TV are not perfect RGB emitters as the results to right demonstrate Three types of cones suggests color is a 3D quantity. How to define 3D color space? Idea: Shine given wavelength ( ) on a screenShine given wavelength ( ) on a screen User must control three lasers producing three wavelengths (say R=700nm, G=546nm, and B=436nm)User must control three lasers producing three wavelengths (say R=700nm, G=546nm, and B=436nm) Adjust intensity of RGB until colors are identical Adjust intensity of RGB until colors are identical Note phosphors of TV are not perfect RGB emitters as the results to right demonstrateNote phosphors of TV are not perfect RGB emitters as the results to right demonstrate

24 A Problem Exists Exact target match ( ) with phosphors not possible Some red had to be added to target color to permit exact match using “knobs” on RGB intensity output of CRTSome red had to be added to target color to permit exact match using “knobs” on RGB intensity output of CRT Equivalently (theoretically), some red could have been removed from CRT outputEquivalently (theoretically), some red could have been removed from CRT output Figure shows that red phosphor must remove some cyan for perfect matchFigure shows that red phosphor must remove some cyan for perfect match CRT phosphors cannot remove cyan, so 500 nm cannot be generatedCRT phosphors cannot remove cyan, so 500 nm cannot be generated Exact target match ( ) with phosphors not possible Some red had to be added to target color to permit exact match using “knobs” on RGB intensity output of CRTSome red had to be added to target color to permit exact match using “knobs” on RGB intensity output of CRT Equivalently (theoretically), some red could have been removed from CRT outputEquivalently (theoretically), some red could have been removed from CRT output Figure shows that red phosphor must remove some cyan for perfect matchFigure shows that red phosphor must remove some cyan for perfect match CRT phosphors cannot remove cyan, so 500 nm cannot be generatedCRT phosphors cannot remove cyan, so 500 nm cannot be generated

25 CIE Color Space No standard set of three wavelengths can be combined to generate all other wavelengths. The CIE (Commission Internationale d’Eclairage) defined three hypothetical lights X, Y, and Z with these spectra: Idea: any wavelength can be matched perceptually by positive combinations of X, Y, and Z No standard set of three wavelengths can be combined to generate all other wavelengths. The CIE (Commission Internationale d’Eclairage) defined three hypothetical lights X, Y, and Z with these spectra: Idea: any wavelength can be matched perceptually by positive combinations of X, Y, and Z x ~ R y ~ G z ~ B

26 CIE Color Space The gamut of all colors perceivable is thus a three- dimensional shape in X, Y, Z Color = xX + yY + zZ The gamut of all colors perceivable is thus a three- dimensional shape in X, Y, Z Color = xX + yY + zZ

27 CIE Chromaticity Diagram (1931) For simplicity, we often project to the 2D plane x + y + z = 1 x = x / (x+y+z) y = y / (x+y+z) z = 1 – x - y

28 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 Since X, Y, and Z are hypothetical light sources, no real device can produce the entire gamut of perceivable color Example: CRT monitor

29 Device Color Gamuts We can use the CIE chromaticity diagram to compare the gamuts of various devices: Note, for example, that a color printer cannot reproduce all shades available on a color monitor We can use the CIE chromaticity diagram to compare the gamuts of various devices: Note, for example, that a color printer cannot reproduce all shades available on a color monitor

30 A Problem With XYZ Colors If we have two colors C1 and C2, and we add  C to both of them, the differences between the original and new colors will not be perceived to be equal This is due to the variation of the just noticeable differences in saturated hues XYZ space is not perceptually uniform LUV space was created to address this problem If we have two colors C1 and C2, and we add  C to both of them, the differences between the original and new colors will not be perceived to be equal This is due to the variation of the just noticeable differences in saturated hues XYZ space is not perceptually uniform LUV space was created to address this problem

31 RGB Color Space (Color Cube) Define colors with (r, g, b) amounts of red, green, and blue

32 RGB Color Gamuts The RGB color cube sits within CIE color space something like this:

33 Converting Color Spaces Simple matrix operation: The transformation C 2 = M -1 2 M 1 C 1 yields RGB on monitor 2 that is equivalent to a given RGB on monitor 1 Simple matrix operation: The transformation C 2 = M -1 2 M 1 C 1 yields RGB on monitor 2 that is equivalent to a given RGB on monitor 1

34 YIQ Color Space YIQ is the color model used for color TV in America. Y is brightness, I (orange-cyan) & Q (green-magenta) are color Note: Y is the same as CIE’s YNote: Y is the same as CIE’s Y Result: Use the Y alone and backwards compatibility with B/W TV!Result: Use the Y alone and backwards compatibility with B/W TV! These days when you convert RGB image to B/W image, the green and blue components are thrown away and red is used to control shades of grey (usually)These days when you convert RGB image to B/W image, the green and blue components are thrown away and red is used to control shades of grey (usually) YIQ is the color model used for color TV in America. Y is brightness, I (orange-cyan) & Q (green-magenta) are color Note: Y is the same as CIE’s YNote: Y is the same as CIE’s Y Result: Use the Y alone and backwards compatibility with B/W TV!Result: Use the Y alone and backwards compatibility with B/W TV! These days when you convert RGB image to B/W image, the green and blue components are thrown away and red is used to control shades of grey (usually)These days when you convert RGB image to B/W image, the green and blue components are thrown away and red is used to control shades of grey (usually)

35 Converting Color Spaces Converting between color models can also be expressed as such a matrix transform: Note the relative unimportance of blue in computing the Y Converting between color models can also be expressed as such a matrix transform: Note the relative unimportance of blue in computing the Y

36 Perceptually Uniform Color Space Color space in which Euclidean distance between two colors in space is proportional to the perceived distance CIE, RGB, not perceptually uniformCIE, RGB, not perceptually uniform –Example with RGB –LUV was created to be perceptually uniform Color space in which Euclidean distance between two colors in space is proportional to the perceived distance CIE, RGB, not perceptually uniformCIE, RGB, not perceptually uniform –Example with RGB –LUV was created to be perceptually uniform

37 The CMY Color Model Cyan, magenta, and yellow are the complements of red, green, and blue We can use them as filters to subtract from whiteWe can use them as filters to subtract from white The space is the same as RGB except the origin is white instead of blackThe space is the same as RGB except the origin is white instead of black This is useful for hardcopy devices like laser printers If you put cyan ink on the page, no red light is reflectedIf you put cyan ink on the page, no red light is reflected Add black as option (CMYK) to match equal parts CMYAdd black as option (CMYK) to match equal parts CMY Cyan, magenta, and yellow are the complements of red, green, and blue We can use them as filters to subtract from whiteWe can use them as filters to subtract from white The space is the same as RGB except the origin is white instead of blackThe space is the same as RGB except the origin is white instead of black This is useful for hardcopy devices like laser printers If you put cyan ink on the page, no red light is reflectedIf you put cyan ink on the page, no red light is reflected Add black as option (CMYK) to match equal parts CMYAdd black as option (CMYK) to match equal parts CMY


Download ppt "CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color."

Similar presentations


Ads by Google