Einführung in Visual Computing 186.822 Color and Color Models Werner Purgathofer Color problem specification light and perception colorimetry device color systems color ordering systems color symbolism Werner Purgathofer 1 1
Color - Why Do We Care? Computer Graphics is all about the generation and the manipulation of color images proper understanding and handling of color is necessary at every step Werner Purgathofer 2 What is Light? light = narrow frequency band of electromagnetic spectrum red border: 380 THz 780 nm violet border: 780 THz 380 nm AM radio FM radio an nd TV icrowaves m frared inf visible traviolet ult X- -rays 10 16 10 14 10 12 10 10 10 8 10 6 10 4 10 2 10 0 10-2 (nm) wavelength 10 2 10 4 10 6 10 8 10 10 10 12 10 14 10 16 10 18 10 20 frequency (Hz) Werner Purgathofer 3 2
Light - An Electromagnetic Wave light is electromagnetic energy monochrome light can be described either by frequency f or wavelength c = f (c = speed of light) shorter wavelength equals higher frequency red 700 nm violet 400 nm E Werner Purgathofer 4 t Light Spectrum normally, a ray of light contains many different waves with individual frequencies the associated distribution of wavelength intensities per wavelength is referred to as the spectrum of a given ray or light source Werner Purgathofer 5 3
Dominant Wavelength Frequency energy white light energy greenish light E D E W wavelength wavelength 400 nm 700 nm dominant wavelength dominant wavelength frequency (hue, color) brightness (area under the curve) purity E E E D...dominant energy density Werner Purgathofer 6 D E D W E W...white light energy density The Human Eye aqueous [Augenkammer] lens cornea [Hornhaut] iris [Regenbogen- haut] retina contains rods: b/w cones: color retina [Netzhaut] vitreous humor [Glaskörper] optical axis visual axis optic disc [Papille] fovea nerve macula lutea [gelber Fleck] Werner Purgathofer 7 rods cones 4
The Human Eye 3 types of cones different wavelength sensitivities: red green blue fraction of absorbed light 16% 8% 4% 2% 1% 400 440 480 520 560 600 640 680 λ Werner Purgathofer 8 Color Blindness red/green blindness red & green cones too similar fraction of absorbed light 16% 8% 4% 2% 1% 400 440 480 520 560 600 640 680 λ Werner Purgathofer 9 5
Color Blindness red/green blindness red & green cones too similar blue blindness other no blue cones cones missing cones too similar fraction of absorbed light 16% 8% 4% 2% 1% 400 440 480 520 560 600 640 680 λ Werner Purgathofer 10 Color Blindness Tests 5 = normal nothing = red/green blind 2 = red/green weak nothing = normal Werner Purgathofer 11 6
Color Blindness Tests 8 = normal 3 = red/green weak nothing = r/g blind 8 = red/green blind 12 = blue/yellow blind 182 = normal Werner Purgathofer 12 Color Spaces (CS) Color Metric Spaces (CIE XYZ, L*a*b*) used to measure absolute values and differences - roots in colorimetry Device Color Spaces (RGB, CMY, CMYK) used in conjunction with device Color Ordering Spaces (HSV, HLS) used to find colors according to some criterion the distinction between them is somewhat obscured by the prevalence of multi-purpose RGB in computer graphics Werner Purgathofer 13 7
What is our Goal? to be able to quantify color in a meaningful, expressive, consistent and reproducible way. problem: color is a perceived quantity, not a direct, physical observable Werner Purgathofer 14 Color - A Visual Sensation object light stimulus eye nerve signal brain electromagnetic rays realm of direct observables color sensation realm of psychology Werner Purgathofer 15 8
Colorimetry CM is the branch of color science concerned with numerically specifying the color of a physically defined visual stimulus in such manner that stimuli with the same specification look alike under the same viewing conditions stimuli that look alike have the same specification the numbers used are continuous functions of the physical parameters Werner Purgathofer 16 Colorimetry Properties Colorimetry only considers the visual discriminability of physical beams of radiation for the purposes of Colorimetry a color is an equivalence class of mutually indiscriminable beams colors in this sense cannot be said to be red, green or any other color name discriminability is decided before the brain - Colorimetry is not psychology Werner Purgathofer 17 9
Color Matching Experiments observers had to match monochromatic test lights by combining 3 fixed primaries test test R+G+B green 0 1 0 1 0 1 goal: find the unique RGB coordinates for each stimulus Werner Purgathofer 18 Color Matching Experiments observers had to match monochromatic test lights by combining 3 fixed primaries R = 700.0 nm G = 546.1 nm B = 435.8 nm viewer controls independently variable primary sources viewing screen test source masking screen Werner Purgathofer 19 10
Tristimulus Values the values R Q, G Q and B Q of a stimulus Q that fulfill test test R+G+B green Q R Q R G Q G B Q B are called the tristimulus values of Q in the case of a monochromatic stimulus Q, the values R, G and B are called the spectral tristimulus values Werner Purgathofer 20 Color Matching Procedure (1) test field = 700 nm-red with radiance P ref observer adjusts luminance of R (G=0, B=0) (2) test light wavelength is decreased in constant steps (radiance P ref stays the same) observer adjusts R, G, B (3) repeat for entire visible range Werner Purgathofer 350 400 450 500 550 600 650 700 nm 11
Color Matching Result!? 100 no match possible!?!? 0 350 400 450 500 550 600 650 700 nm observers want to subtract red light from the match side...!? Werner Purgathofer 22 Color Matching Experiment Problem for some colors observers want to reduce red light to negative values!? but there is no negative light! test test t R+ +G+B green? 0 1 0 1 0 1 Werner Purgathofer 23 12
Negative Light in a Color Matching Exp. if a match using only positive RGB values proved impossible, observers could simulate a subtraction of red from the match side by adding it to the test side test tes st + R G+B green 0 1 0 1 0 1 0 1 Werner Purgathofer 24 CIE RGB Color Matching Functions 100 b(λ) g(λ) r(λ) 0? 350 400 450 500 550 600 650 700 nm 435.8 nm 546.1 nm 700.0 nm Werner Purgathofer 25 13
CIE XYZ problem solution: XYZ color system tristimulus system derived from RGB based on 3 imaginaryi primaries i all 3 primaries are imaginary colors only positive XYZ values can occur! 1931 by CIE (Commission Internationale de l Eclairage) Werner Purgathofer 26 Y Z X RGB vs. XYZ negative component disappears y( ) is the achromatic luminance sensitivity RGB system XYZ system b(λ) r(λ) g(λ) 1 z(λ) y(λ) x(λ) 0 350 400 450 500 550 600 650 700 nm 350 400 450 500 550 600 650 700 nm amounts of RGB primaries needed to display spectral colors Werner Purgathofer 27 amounts of CIE primaries needed to display spectral colors 14
CIE Color Model Formulas XYZ color model C( ) = XX + YY + ZZ (X, Y, Z are primaries) normalized chromaticity values x, y X x X Y Z ( z = 1 x y ) Y y X Y Z Y 1 complete description of color: x, y, Y Werner Purgathofer 28 1 Z 1 X CIE Chromaticity Diagram spectral colors identifying complementary colors determining dominant wavelength, purity comparing color gamuts purple line spectral color positions are along the boundary curve Werner Purgathofer 29 15
Properties of CIE Diagram (2) C 1 representing complementary colors on the chromaticity diagram C C 2 Werner Purgathofer 30 Properties of CIE Diagram (3) C sp C s determining dominant wavelength and purity with the chromaticity diagram C 1 C C 2 Cp C 1 C s C 2 C p? complement C sp Werner Purgathofer 31 16
Color Spaces (CS) Color Metric Spaces (CIE XYZ, L*a*b) used to measure absolute values and differences - roots in colorimetry Device Color Spaces (RGB, CMY, CMYK) used in conjunction with device Color Ordering Spaces (HSV, HLS) used to find colors according to some criterion the distinction between them is somewhat obscured by the prevalence of multi-purpose RGB in computer graphics Werner Purgathofer 32 RGB Color Model cyan (0,1,1) blue (0,0,1) green (0,1,0) black (0,0,0) white (1,1,1) magenta (1,0,1) yellow (1,1,0) red (1,0,0) primary colors red, green, blue additive color model (for monitors) Werner Purgathofer 33 C( ) = RR + GG + BB 17
RGB Color Model Images 3 views of the RGB color cube Werner Purgathofer 34 Gamuts of RGB Monitors monitor gamuts can be very different no monitor can display all colors Werner Purgathofer 35 18
CMY Color Model magenta (0,1,0) blue (1,1,0) red (011) (0,1,1) black (1,1,1) yellow (0,0,1) white (0,0,0) green (1,0,1) cyan (1,0,0) Werner Purgathofer 36 primary colors cyan, magenta, yellow subtractive color model (for hardcopy devices) C=G+B, using C subtracts R C 1 R M 1 G Y 1 B CMY Color Model Images 3 views of the CMY color cube Werner Purgathofer 37 19
Gamuts of CMY(K) Printers printer gamuts can be very different no printer can display all colors Werner Purgathofer 38 Color Spaces (CS) Color Metric Spaces (CIE XYZ, L*a*b) used to measure absolute values and differences - roots in colorimetry Device Color Spaces (RGB, CMY, CMYK) used in conjunction with device Color Ordering Spaces (HSV, HLS) used to find colors according to some criterion the distinction between them is somewhat obscured by the prevalence of multi-purpose RGB in computer graphics Werner Purgathofer 39 20
Colour Ordering Systems (COS) primary aim: enable the user to intuitively choose colour values according to certain criteria choice can yield single or multiple colour values examples: HSV, HLS, Munsell, NCS, RAL Design, Coloroid used in bottom-up parts of a design process sometimes physical samples are provided Werner Purgathofer 40 HSV Color Model more intuitive color specification derived from the RGB color model: when the RGB color cube is viewed along the diagonal from white to black, the color cube outline is a hexagon RGB Color Cube Werner Purgathofer 41 Color Hexagon 21
HSV Color Model Hexcone color components: hue (H) [0, 360 ] saturation (S) [0, 1] value (V) [0, 1] HSV hexcone Werner Purgathofer 42 HSV Color Model Hexcone color components: hue (H) [0, 360 ] saturation (S) [0, 1] value (V) [0, 1] HSV hexcone Werner Purgathofer 43 22
HSV Color Definition color definition select hue, S=1, V=1 add black pigments, pg i.e., decrease V add white pigments, i.e., decrease S Shades cross section of the HSV hexcone showing regions for shades, tints, and tones Werner Purgathofer 44 S HLS Color Model color components: hue (H) [0, 360 ] lightness (L) [0, 1] saturation (S) [0, 1] HLS double cone Werner Purgathofer 45 23
Color Model Summary Colorimetry: CIE XYZ: contains all visible colours Device Color Systems: RGB: additive device color space (monitors) CMY(K): subtractive device color space (printers) YIQ: television (NTSC) (Y=luminance, I=R-Y, Q=B-Y) Color Ordering Systems: HSV, HLS: for user interfaces Werner Purgathofer 46 Color Symbolism: Some Aspects 6 to 11 basic colors categories, hierarchies dependentd on context t / application large variation in use what is red? what is blue? what is white?! Werner Purgathofer 47 24
Color in Religion Islam: green Buddhism: yellow, orange, red & purple Hinduism: orange, blue & blue-violet Christs: liturgical colors without theological connex Werner Purgathofer 48 Political Symbol Colors parties revolutions / movements flags Werner Purgathofer 49 25
Color Labeling at home water pipes electrical wires traffic... waste separation traffic signs traffic lights parking concepts public transport Werner Purgathofer 50 Color Labeling technology resistors thermochrome colors nature courtship [Balz] warning colors protective mimicry [Tarnfarben] Werner Purgathofer 51 26
Color Effect: BLUE distance faithfulness, loyality desire phantasy male devine peace cold Werner Purgathofer 52 Color Effect: RED blood energy love female rich, noble labor movement warm corrections Werner Purgathofer 53 27
Color Effect: GREEN profit young love hope prematurity, unripe poison nature neutral environment protection Werner Purgathofer 54 Color Effect: YELLOW sun optimism enlightenment t jealousy [Neid] stinginess [Geiz] warning color warm Werner Purgathofer 55 28
Color Effect: BLACK end, death sadness negative emotions bad luck elegance emptiness cold Werner Purgathofer 56 Einführung in Visual Computing 186.822 Color and Color Models The End 29