CG-lecture09 - Introduction to Computer Graphics Lecture 9...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to Computer Graphics Lecture 9 Color Color Next topic: Color Next Color To understand how to make realistic images, To 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. basic Basics Of Color Elements of color: Rendering with Natural Light Basics of Color Physics: Physics: • Illumination – Electromagnetic spectra • Reflection – Material properties – Surface geometry and microgeometry (i.e., polished versus matte Surface versus brushed) versus Perception • Physiology and neurophysiology • Perceptual psychology Physiology of Vision The eye: The retina • Rods • Cones – Color! Physiology of Vision The center of the retina is a densely packed The region called the fovea. fovea • Cones much denser here than the periphery Cones periphery Physiology of Vision: Cones Three types of cones: • L or R, most sensitive to red light (610 nm) most • 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) Perception: Metamers A given perceptual sensation of color derives given from the stimulus of all three cone types from Identical perceptions of color can thus be caused Identical by very different spectra by Perception: Other Gotchas Color perception is also difficult because: • It varies from person to person • It is affected by adaptation (stare at a light bulb… don’t) • It is affected by surrounding color: Perception: Relative Intensity We are not good at judging absolute intensity Let’s illuminate pixels with white light on scale of 0 - 1.0 Intensity difference of neighboring colored rectangles Intensity with intensities: with 0.10 -> 0.11 (10% change) 0.50 -> 0.55 (10% change) will look the same We perceive relative intensities, not absolute We relative Combining Colors Additive (RGB) Shining colored lights on a white ball Subtractive (CMYK) Mixing paint colors and illuminating with white light Specifying Color Color perception usually involves three quantities: • Hue: Distinguishes between colors like red, green, blue, etc • Saturation: How far the color is from a gray of equal intensity • Lightness: The perceived intensity of a reflecting object Sometimes lightness is called brightness if the object is Sometimes emitting light instead of reflecting it. emitting In order to use color precisely in computer graphics, we In need to be able to specify and measure colors. need HSV Color Space Computer scientists frequently use an intuitive Computer color space : color • 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) saturated • Brightness (Luminance) - How bright is the color (how bright are the lights illuminating the object?) are HSV Color Model Hue (H) is the angle Hue around the vertical axis around 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 Value the hexcone” the HSV Color Model H 0 120 240 * * * 60 270 270 S 1.0 1.0 1.0 0.0 0.0 * 1.0 0.5 0.0 V 1.0 1.0 1.0 1.0 0.5 0.0 1.0 1.0 0.7 Figure 15.16&15.17 from H&B Color Red Green Blue White Gray Black ? ? ? Intuitive Color Spaces A top-down view of hexcone HSV Color Space A more intuitive color space • H = Hue • S = Saturation • V = Value (or brightness) Hue Saturation Value Precise Color Specifications • Pigment-mixing is subjective --- depends on human observer, Pigment-mixing surrounding colors, lighting of the environment, etc surrounding • We need an objective color specification • Light is electromagnetic energy in the 400 to 700 nm wavelength Light range range • Dominant wavelength is the wavelength of the color we “see” • Excitation purity is the proportion of pure colored light to white light • Luminance is the amount (or intensity) of the light is Electromagnetic Spectrum Visible light frequencies range between ... 14 • Red = 4.3 x 1014 hertz (700nm) hertz 14 • Violet = 7.5 x 1014 hertz (400nm) hertz Figures 15.1 from H&B Visible Light Hue = dominant frequency (highest peak) Saturation = excitation purity (ratio of highest to rest) Lightness = luminance (area under curve) White Light Figures 15.3-4 from H&B Orange Light How well do we see color? What color do we see the best? • Yellow-green at 550 nm What color do we see the worst? • Blue at 440 nm Flashback: Colortables (colormaps) for color Flashback: storage storage • Which RGB value gets the most bits? Human Color Vision Humans have 3 light sensitive pigments in their cones, Humans called L, M, and S called Each has a different Each spectral response curve: spectral L = ∫ L(λ )E(λ )dλ M = ∫ M( λ) E( λ) dλ S = ∫ S(λ )E(λ )dλ This leads to metamerism “Tristimulus” color theory Color Spaces Three types of cones suggests color is a 3D quantity. How Three to define 3D color space? to Idea: Idea: • Shine given wavelength (λ ) on a screen • User must control three lasers producing three wavelengths (say User R=700nm, G=546nm, and B=436nm) R=700nm, • Adjust intensity of RGB until colors are identical Adjust • Note phosphors of TV are not perfect RGB emitters as the results to right demonstrate A Problem Exists Exact target match (λ ) with phosphors not possible • Some red had to be added to target color to permit exact match using Some “knobs” on RGB intensity output of CRT “knobs” • Equivalently (theoretically), Equivalently some red could have been removed from CRT output removed • Figure shows that red Figure phosphor must remove some cyan for perfect match cyan • CRT phosphors cannot CRT remove cyan, so 500 nm cannot be generated cannot CIE Color Space No standard set of three wavelengths can be No combined to generate all other wavelengths. combined The CIE (Commission Internationale d’Eclairage) The CIE defined three hypothetical lights X, Y, and Z with these spectra: these Idea: any wavelength λ can Idea: be matched perceptually by positive combinations positive of X, Y, and Z of x~R y~G z~B CIE Color Space The gamut of all colors perceivable is thus a threeThe gamut dimensional shape in X, Y, Z Color = xX + yY + zZ 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 Device Color Gamuts Since X, Y, and Z are hypothetical light sources, Since no real device can produce the entire gamut of perceivable color perceivable Example: CRT monitor Device Color Gamuts We can use the CIE chromaticity diagram to We compare the gamuts of various devices: compare Note, for example, Note, that a color printer that cannot reproduce all shades available on a color monitor RGB Color Space (Color Cube) Define colors with (r, g, b) amounts of red, green, Define and blue and RGB Color Gamuts The RGB color cube sits within CIE color space The something like this: something Converting Color Spaces Simple matrix operation: R ' XR G ' = YR B ' ZR XG YG ZG XB R YB G ZB B The transformation C2 = M-12 M1 C1 yields RGB on The monitor 2 that is equivalent to a given RGB on monitor 1 monitor The CMY Color Model Cyan, magenta, and yellow are the complements Cyan, of red, green, and blue of • We can use them as filters to subtract from white • The space is the same as RGB except the origin is white The instead of black instead This is useful for hardcopy This devices like laser printers devices C 1 R M = 1 − G Y 1 B • If you put cyan ink on the page, no red light is reflected • Add black as option (CMYK) to match equal parts CMY Halftoning A technique used in newspaper printing Only two intensities are possible, blob of ink and no Only blob of ink blob But, the size of the blob can be varied Also, the dither patterns of small dots can be used Halftoning Halftoning – dot size Halftoning – Moire Patterns Repeated use of same dot Repeated pattern for particular shade results in repeated pattern repeated • Perceived as a moire pattern • Instead, randomize halftone Instead, pattern pattern Dithering Halftoning for color images ...
View Full Document

Ask a homework question - tutors are online