Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 551 / 645: Introductory Computer Graphics Color.

Similar presentations


Presentation on theme: "CS 551 / 645: Introductory Computer Graphics Color."— Presentation transcript:

1 CS 551 / 645: Introductory Computer Graphics Color

2 Administrivia l Changes to assignment 2 l Today’s reading material: FvD, Chapter 13 l Final Exam –Monday, December 11 th, 2000 –7:00 - 10:00 p.m. –MEC 339 –Check your schedule for collisions ASAP! –You will collide if you are taking any of the following: n APMA 109, 111; ITAL 101, 102; LATI 103, 201, 202 n SPAN 101, 102, 201, 202

3 Assignment 2 l For use on Windows box –change.C extension to.cpp extension –remove unistd.h inclusion –remove GL.h and GLU.h inclusion. glut.h includes these –No memory deallocation eats through memory. If you care, add deallocation to the ESCAPE key handler. l sgi-10 is screwed up. You can compile on another SGI and run on sgi-10, though l Don’t worry about the cat or horse l Do zooming with up/down. Ignore left/right.

4 Assignment 2 l Euler angle rotations are bad –Rotate about x, followed by rotate about y, followed by rotate about z –Example: n Rotate 180 degrees about x n A rotation about y will turn in the opposite direction you expect l You can leave the code the way it is now. We will fix it in future assignments

5 Color l 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.

6 Basics Of Color l Elements of color:

7 Basics of Color l Physics: –Illumination n Electromagnetic spectra –Reflection n Material properties n Surface geometry and microgeometry (i.e., polished versus matte versus brushed) l Perception –Physiology and neurophysiology –Perceptual psychology

8 Physiology of Vision l The eye: l The retina –Rods –Cones n Color!

9 Physiology of Vision l The center of the retina is a densely packed region called the fovea. –Cones much denser here than the periphery

10 Physiology of Vision: Cones l 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)

11 Physiology of Vision: The Retina l Strangely, rods and cones are at the back of the retina, behind a mostly- transparent neural structure that collects their response.

12 Perception: Metamers l A given perceptual sensation of color derives from the stimulus of all three cone types l Identical perceptions of color can thus be caused by very different spectra

13 Perception: Other Gotchas l 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:

14 Perception: Relative Intensity We are not good at judging absolute intensity l Let’s illuminate pixels with white light on scale of 0 - 1.0 l Intensity difference of neighboring colored rectangles with intensities: –0.10 -> 0.11 –0.50 -> 0.55 will look the same l We perceive relative intensities, not absolute

15 Representing Intensities l Remaining in the world of black and white… l Use photometer to obtain min and max brightness of monitor l This is the dynamic range l Intensity ranges from min, I 0, to max, 1.0 l How do we represent 256 shades of gray?

16 Representing Intensities l Equal distribution between min and max fails –relative change near max is much smaller than near I 0 l I 0 = I 0, I 1 = rI 0, I 2 = rI 1 = r 2 I 0,…, I 255 = rI 254 = r 255 I 0 l Ex: 4 intensities –1/8, 1/4, 1/2, 1

17 Dynamic Ranges Dynamic RangeMax Perceived Display(max / min illum)Intensities, r=1.01 l CRT:50-200400-530 l Photo (print)100465 l Photo (slide)1000700 l B/W printout100465 l Color printout50400 l Newspaper10234

18 Gamma Correction But most display devices are inherently nonlinear: Intensity = k(voltage)  –I.e., brightness(voltage) != 2*brightness(voltage/2)  is between 2.2 and 2.5 on most monitors l Common solution: gamma correction –Post-transformation on intensities to map them to linear range on display device: –Can have separate  for R, G, B

19 Gamma Correction l Some monitors perform the gamma correction in hardware (SGI’s) l Others do not (most PCs) l Tough to generate images that look good on both platforms (i.e. images from web pages)

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

21 Back to color l Color is defined many ways l Computer scientists frequently use: –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) –Brightness - How bright is the color

22 How well do we see color? l What color do we see the best? –Yellow-green at 550 nm l What color do we see the worst? –Blue at 440 nm l Flashback: Colortables (colormaps) for color storage l Can perceive color differences of 10 nm at extremes (violet and red) and 2 nm between blue and yellow

23 How well do we see color? l 128 fully saturated hues can be distinguished l Cannot perceive hue differences with less saturated light. l Sensitivity to changes in saturation for a fixed hue and brightness ranges from 23 to 16 depending on hue.

24 Color Spaces l Three types of cones suggests color is a 3D quantity. How to define 3D color space? l 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:

25 CIE Color Space l The CIE (Commission Internationale d’Eclairage) came up with three hypothetical lights X, Y, and Z with these spectra: l Idea: any wavelength can be matched perceptually by positive combinations of X,Y,Z l Note that: X ~ R Y ~ G Z ~ B

26 CIE Color Space l The gamut of all colors perceivable is thus a three-dimensional shape in X,Y,Z: l 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

27 CIE Chromaticity Diagram (1931)

28 Device Color Gamuts l Since X, Y, and Z are hypothetical light sources, no real device can produce the entire gamut of perceivable color l Example: CRT monitor

29 Device Color Gamuts l The RGB color cube sits within CIE color space something like this:

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

31 Converting Color Spaces l 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

32 Converting Color Spaces l Converting between color models can also be expressed as such a matrix transform: l Note the relative unimportance of blue in computing the Y l 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!

33 HSV Color Space l A more intuitive color space –H = Hue –S = Saturation –V = Value (or brightness)


Download ppt "CS 551 / 645: Introductory Computer Graphics Color."

Similar presentations


Ads by Google