Скачать презентацию Raster Graphics and Color Aaron Bloomfield CS 445 Скачать презентацию Raster Graphics and Color Aaron Bloomfield CS 445

b776d6888db287eb31c21ab7a497d79c.ppt

  • Количество слайдов: 51

Raster Graphics and Color Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 Raster Graphics and Color Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006

Overview n Display hardware n n Raster graphics systems n n How are imaging Overview n Display hardware n n Raster graphics systems n n How are imaging systems organized? Color models n n How are images displayed? How can we describe and represent colors? All non-credited images in this slide set are from Wikipedia 2

Overview n Display hardware n n Raster graphics systems n n How are images Overview n Display hardware n n Raster graphics systems n n How are images displayed? How are imaging systems organized? Color models n How can we describe and represent colors? 3

Display Hardware n Video display devices n n n Cathode Ray Tube (CRT) Liquid Display Hardware n Video display devices n n n Cathode Ray Tube (CRT) Liquid Crystal Display (LCD) Plasma panels Thin-film electroluminescent displays Light-emitting diodes (LED) Hard-copy devices n n n Ink-jet printer Laser printer Film recorder Electrostatic printer Pen plotter 4

Cathode Ray Tube (CRT) 1. 2. 3. 4. Electron guns Electron beams Focusing coils Cathode Ray Tube (CRT) 1. 2. 3. 4. Electron guns Electron beams Focusing coils Deflection coils 5. 6. 7. 8. n Anode connection Mask for separating beams for RGB part of displayed image Phosphor layer with RGB zones Close-up of the phosphor-coated inner side of the screen Image via Wikipedia: http: //en. wikipedia. org/wiki/Cathode_ray_tube 5

Liquid Crystal Display (LCD) Figure 2. 16 from H&B 6 Liquid Crystal Display (LCD) Figure 2. 16 from H&B 6

Display Hardware n Video display devices » » n n Cathode Ray Tube (CRT) Display Hardware n Video display devices » » n n Cathode Ray Tube (CRT) Liquid Crystal Display (LCD) Plasma panels Thin-film electroluminescent displays Light-emitting diodes (LED) Hard-copy devices n n n Ink-jet printer Laser printer Film recorder Electrostatic printer Pen plotter 7

Overview n Display hardware n n Raster graphics systems n n How are images Overview n Display hardware n n Raster graphics systems n n How are images displayed? How are imaging systems organized? Color models n How can we describe and represent colors? 8

Raster Graphics Systems I/O Devices System Bus Display Processor CPU System Memory Frame Buffer Raster Graphics Systems I/O Devices System Bus Display Processor CPU System Memory Frame Buffer Video Controller Monitor Figure 2. 29 from H&B 9

Frame Buffer Figure 1. 2 from Fv. DFH 10 Frame Buffer Figure 1. 2 from Fv. DFH 10

Frame Buffer Refresh rate is usually 60 -120 Hz for CRTs Figure 1. 3 Frame Buffer Refresh rate is usually 60 -120 Hz for CRTs Figure 1. 3 from Fv. DFH 11

Direct Color Framebuffer n n Store the actual intensities of R, G, and B Direct Color Framebuffer n n Store the actual intensities of R, G, and B individually in the framebuffer 24 bits per pixel = 8 bits red, 8 bits green, 8 bits blue DAC 12

Red component vs. monochromatic n The red component only has the red components of Red component vs. monochromatic n The red component only has the red components of each pixel (duh!) n Monochromatic is a grayscale image that uses another color instead of white 13

Color Lookup Framebuffer n n Store indices (usually 8 bits) in framebuffer Display controller Color Lookup Framebuffer n n Store indices (usually 8 bits) in framebuffer Display controller looks up the R, G, B values before triggering the electron guns DAC Color indices 14

Color CRT Figure 2. 8 from H&B 15 Color CRT Figure 2. 8 from H&B 15

Overview n Display hardware n n Raster graphics systems n » How are images Overview n Display hardware n n Raster graphics systems n » How are images displayed? How are imaging systems organized? Color models n How can we describe and represent colors? 16

Specifying Color n Color perception usually involves three quantities: n n n Hue: Distinguishes Specifying Color n Color perception usually involves three quantities: n n n 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 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. 17

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

Additive color vs. Subtractive color n Additive colors models are used in light n Additive color vs. Subtractive color n Additive colors models are used in light n n Subtractive color models are used with paint n n n Start with black, and add colored light to make your desired shade Start with white, and add colors A given color – red – subtracts away (from the reflected light) any wavelength that is not red Additive color mixing: n Subtractive color mixing: 19

HSV Color Model H 0 120 240 * * * 60 270 S 1. HSV Color Model H 0 120 240 * * * 60 270 S 1. 0 0. 0 * 1. 0 0. 5 0. 0 V 1. 0 0. 5 0. 0 1. 0 0. 7 Color Red Green Blue White Gray Black ? ? ? Figure 15. 16&15. 17 from H&B 20

Intuitive Color Spaces n n n HSV is an intuitive color space Corresponds to Intuitive Color Spaces n n n HSV is an intuitive color space Corresponds to our perceptual notions of tint, shade, and tone 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” 21

Precise Color Specifications n n n Pigment-mixing is subjective --- depends on human observer, Precise Color Specifications n n n Pigment-mixing is subjective --- depends on human observer, surrounding colors, lighting of the environment, etc We need an objective color specification Light is electromagnetic energy in the 400 to 700 nm wavelength 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 22

Electromagnetic Spectrum n Visible light frequencies range between. . . n n Red = Electromagnetic Spectrum n Visible light frequencies range between. . . n n Red = 4. 3 x 1014 hertz (700 nm) Violet = 7. 5 x 1014 hertz (400 nm) Figures 15. 1 from H&B 23

Visible Light n n n Hue = dominant frequency (highest peak) Saturation = excitation Visible Light n n n Hue = dominant frequency (highest peak) Saturation = excitation purity (ratio of highest to rest) Lightness = luminance (area under curve) White Light Orange Light Figures 15. 3 -4 from H&B 24

Color Matching n In order to match a color, we can adjust the brightness Color Matching n In order to match a color, we can adjust the brightness of 3 overlapping primaries until the two colors look the same. n n C = color to be matched RGB = laser sources (R=700 nm, G=546 nm, B=435 nm) C R B G C=R+G+B n C R G B C+R=G+B Humans have trichromatic color vision 25

Linear Color Matching n Grassman’s Laws: 1. Scaling the color and the primaries by Linear Color Matching n Grassman’s Laws: 1. Scaling the color and the primaries by the same factor preserves the match: 2 C = 2 R + 2 G + 2 B 2. To match a color formed by adding two colors, add the primaries for each color C 1 + C 2 = (R 1 + R 2) + (G 1 + G 2) + (B 1 + B 2) 26

RGB Spectral Colors n n Match each pure color in the visible spectrum (rainbow) RGB Spectral Colors n n Match each pure color in the visible spectrum (rainbow) Record the color coordinates as a function of wavelength ? 27

Perception of color intensities n n n Which shade of gray is half-way between Perception of color intensities n n n Which shade of gray is half-way between white and black? It’s the second one Humans perceive color intensity (and sound, etc. ) on a logarithmic scale n The first one is (about) 3/4 lit n n The second one is 1/2 lit n n We perceive it as 1/2 lit We perceive it as 1/4 lit That exponent is called gamma ( ) n 2. 0 is a sample value for a CRT or LCD monitor 28

Human Color Vision n n Humans have 3 light sensitive pigments in their cones, Human Color Vision n n Humans have 3 light sensitive pigments in their cones, called L, M, and S The cones respond to different lights: n n n L to red M to green S to blue This leads to metamerism “Tristimulus” color theory 29

Just Noticeable Differences n n The human eye can distinguish hundreds of thousands of Just Noticeable Differences n n The human eye can distinguish hundreds of thousands of different colors When two colors differ only in hue, the wavelength between just noticeably different colors varies with the wavelength! n n n More than 10 nm at the extremes of the spectrum Less than 2 nm around blue and yellow Most JND hues are within 4 nm. Altogether, the eye can distinguish about 128 fully saturated hues Human eyes are less sensitive to hue changes in less saturated light (not a surprise) 30

Luminance n n Compare color source to a gray source Luminance n n Y Luminance n n Compare color source to a gray source Luminance n n Y =. 30 R +. 59 G +. 11 B Color signal on a black and white TV 31

Chromaticity and the CIE n n n Negative spectral matching functions? Some colors cannot Chromaticity and the CIE n n n Negative spectral matching functions? Some colors cannot be represented by RGB Enter the CIE Three new standard primaries called X, Y, and Z Y has a spectral matching function exactly equal to the human response to luminance 32

XYZ Matching Functions n n Match all visible colors with only positive weights Y XYZ Matching Functions n n Match all visible colors with only positive weights Y matches luminance These functions are defined tabularly at 1 -nm intervals Linear combinations of the R, G, B matching functions 33

CIE Color Space 34 CIE Color Space 34

Spectral Locus n n Human perceptual gamut The cone keeps going towards the right Spectral Locus n n Human perceptual gamut The cone keeps going towards the right n Brightness (not whiteness!) keeps increasing From http: //pages. infinit. net/graxx/Theorie 4. html 35

Chromaticity Diagram Converting from RGB to XYZ is a snap: Given x, y, and Chromaticity Diagram Converting from RGB to XYZ is a snap: Given x, y, and Y, we can recover the X, Y, Z coordinates 36

Measuring Color n n n Colorimeters measure the X, Y, and Z values for Measuring Color n n n Colorimeters measure the X, Y, and Z values for any color A line between the “white point” of the chromaticity diagram and the measured color intersects the horseshoe curve at exactly the dominant wavelength of the measured color A ratio of lengths will give the excitation purity of the color Complementary colors are two colors that mix to produce pure white Some colors are non-spectral --- their dominant wavelength is defined as the same as their complimentary color, with a “c” on the end 37

Gamuts 38 Gamuts 38

Gamut problems n n n Monitor gamuts are RGB Printer gamuts are CMYK Each Gamut problems n n n Monitor gamuts are RGB Printer gamuts are CMYK Each can display colors the other cannot 39

A Problem With XYZ Colors n If we have two colors C 1 and A Problem With XYZ Colors n If we have two colors C 1 and C 2, and we add C to both of them, the differences between the original and new colors will not be perceived to be equal n n n add green n n C 1: C 2: add green 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 40

The RGB Color Model n n n This is the model used in color The RGB Color Model n n n This is the model used in color CRT monitors RGB are additive primaries We can represent this space as a unit cube: From http: //ian-albert. com/graphics/rgb. php 41

More on RGB n n The color gamut covered by the RGB model is More on RGB n n The color gamut covered by the RGB model is determined by the chromaticites of the three phosphors To convert a color from the gamut of one monitor to the gamut of another, we first measure the chromaticities of the phosphors Then, convert the color to XYZ space, and finally to the gamut of the second monitor We can do this all with a single matrix multiply 42

The CMY Color Model n Cyan, magenta, and yellow are the complements of red, The CMY Color Model n Cyan, magenta, and yellow are the complements of red, green, and blue n n n We can use them as filters to subtract from white The space is the same as RGB except the origin is white instead of black This is useful for hardcopy devices like laser printers n If you put cyan ink on the page, no red light is reflected 43

CMYK n n n Most printers actually add a fourth color, black Use black CMYK n n n Most printers actually add a fourth color, black Use black in place of equal amounts of C, M, and Y Why? n n Black ink is darker than mixing C, M, and Y Black ink is cheaper than colored ink 44

CMY vs CMYK n n n You can create (more or less) any color CMY vs CMYK n n n You can create (more or less) any color with each gamut Colored printer ink is more expensive Notice how much less CMY is needed in the CMYK version One of the reasons printers use CMYK And color mixing… 45

The YIQ Color Model n n n n YIQ is used to encode television The YIQ Color Model n n n n YIQ is used to encode television signals Y is the CIE Y primary, not yellow Y is luminance, so I and Q encode the chromaticity of the color If we just throw I and Q away, we have black and white TV This assumes known chromaticities for your monitor Backwards compatibility with black and white TV More bandwidth can be assigned to Y 46

HSV color space aside n Consider a HSV picture space: n n n Let’s HSV color space aside n Consider a HSV picture space: n n n Let’s call the blue axis Cb n n Blue and red are at right angles to each other Thus, with 2 coordinates, you can define any saturation/hue combination It defines the blue/yellow combination And the red axis Cr n It defines the red/cyan combination 47

The YCb. Cr Color Model n Y is luma (similar to luminance) n n The YCb. Cr Color Model n Y is luma (similar to luminance) n n Cb and Cr define the chrominance n n The brightness of a pixel Meaning they each define saturation and hue Cb is the blue chroma, Cr is the red From the last slide Notice the murkiness of the Cr and Cb components n The human eye does notice differences in them nearly as much 48

JPEG Image Compression n Take an image in the (r, g, b) color space JPEG Image Compression n Take an image in the (r, g, b) color space n n Convert it to YCb. Cr n n Let’s say 4 bits (24 = 16) So it can have values 0, 15, 31, 47, … 255 Each pixel now takes up 16 bits n n Also 8 bits per image Downsample Cb and Cr to fewer bits n n Assume it’s 8 bits per image (24 bits total) 8 for Y, 4 for Cb and 4 for Cr Then do some other magic (including zip-like compression) And you have a (lossy) compressed image 49

Future of color displays n Future color displays may have more pixels n n Future of color displays n Future color displays may have more pixels n n Will allow much more vivid color n n RGB plus yellow, cyan, etc. A greater gamut of color possibilities Note that both the pictures on the right are being displayed by an RGB output device… 50

Photo printers n Photo printers use many ink colors for rich, vivid color n Photo printers n Photo printers use many ink colors for rich, vivid color n Also a scam to sell you more ink (the razor business model) 51