Sie sind auf Seite 1von 17

Color Models and Color Applications

Color Models and Color Applications

Outline
n n n n n n n n

Properties of Light Standard Primaries and the Chromaticity Diagram


n

XYZ Color Model and CIE Chromaticity Diagram

Intuitive Color Concepts RGB , YIQ , CMY , and HSV Color Models Conversion Between HSV and RGB Models HLS Color Model Color Selection and Applications Summary
2

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

Introduction
n

What is the color model


n n

A method for explaining the properties or behavior of color within some context No single model can explain all aspects of color RGB, YIQ, CMY, HSV, and HSL Different output devices, video monitor, printer, plotter, and so on

Why color models


n n

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Properties of Light
n

Three properties we perceive in a light source n Hue n Brightness n Purity, Saturation

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

Electromagnetic Spectrum
n n

What we perceived as "light", or different colors


n

A narrow frequency band within the electromagnetic spectrum

Each frequency within the visible band corresponds to a distinct color


n

From the red(4.3*1012Hz) to the highest frequency violet (7.5*1014Hz)


FM Radio and TV

Microwaves

Ultraviolet

AM Radio

Infrared

Visible

X-rays

102 104 106 108 1010 10121014 1016 1018 1020

Frequency (Hertz) 5

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Hue
n n

What is the "Hue"


n

A dominant frequency of the light The combination of frequencies present in the reflected light determines the color of the object

The color of a object


n

A White Light Source

Reflected Light WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME 6

Color Models and Color Applications

Hue (Cont.)
n

Example
n n

White light source, see Fig. 15-3 Lower frequencies are predominant in the reflected light, red object, see Fig. 15-4 Energy ED EW Frequency

Energy

Red Fig. 15-3

Violet Fig. 15-4

Violet

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Brightness
n

What is the "brightness"


n

The perceived intensity of the light

Intensity
n

Is the radiant energy emitted per unit time, per unit solid angle, and per unit projected area of the source

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

Purity or Saturation
n n

What is the "Saturation"


n

How "pure" the color of the light appears Hue = ED Brightness = the area under the curve Saturation = ED - EW ED EW Frequency

Illustration
n n n

Dominant Frequency

Violet Fig. 15-4 WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Matching
n

Some different-color light sources with suitably chosen intensities can be used to produce a range of other colors approximately Color gamut
n

Color model use three colors to obtain a wide range of colors The two or three colors used to produce other colors in a color model Color A + Color B = White Color
10

Primary colors
n

Complementary color
n

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

Color Matching Function


n n

The color matching , see Fig. 12-6 The RGB color matching function, see Fig. 12-5
n

See the text book

test light

445nm 535nm 630nm

Fig. 15-5 WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME 11

Standard Primaries and the Chromaticity Diagram


n

Standard Primaries
n n

Since no finite set of color light sources can be combined to obtain all possible colors Three standard primaries
n

Defined mathematically with positive color matching function , see Fig. 12-6, in 1931 by CIE (International Commission on Illumination) Imaginary colors

Provide an international standard definition for all colors


n

XYZ color model


12

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

XYZ Color Model


n

Any color C = XX+YY+ZZ X Y Z n X, Y, and Z represent vectors in 3D


n

X, Y, and Z designate the amounts of the standard primaries x= X/(X+Y+Z), y= Y/(X+Y+Z), z= Z/(X+Y+Z) x+y+z= 1 Any color can be represented with just x and y Depends only on hue and purity(saturation)
13

Normalizing the amounts


n n

Chromaticity value (x, y)


n

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

CIE Chromaticity Diagram


n

According to chromaticity values (x, y), we have the tongue-shaped curve, see Fig. 12-7
n n n

Points along the curve are the "pure" colors Interior points represent all possible visible color combinations Point C is the white light position
n

average daylight

Colors with different illuminance but the same chromaticity map to the same point Comparing color gamuts for different sets of primaries Identifying complimentary colors Determining dominant wavelength and the purity of a given color 14

The chromaticity diagram is useful for


n n n

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

CIE Chromaticity Diagram (Cont.)


y 520 (green) 500 (cyan) (blue) C 540 560 580(yellow) 600 700(red)

480 400(violet) x Fig. 12-7 WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME 15

Color Gamut
n Straight
n

line

All colors along the line(C1, C2) can be obtained by C12= C1 + C2, +=1 C3, C4, and C5 can only generate colors inside or on the bounding edges of the triangle

C1 C3

C2 C4

n Polygons
n

C5 x Fig. 12-8 16

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Models and Color Applications

Complimentary Color
n

Mixing C1 and C2, we obtain white color y


n

C= C1 + C2

So, the complimentary color of C1 is C - C1

C1

C2

Fig. 12-9 WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

x 17

Dominant Wavelength and Purity


n n

Dominant wavelength of C1 is Cs
n

The half line (C, C1) intersects the spectral curve at points, Cs The ratio of Distance(C, C1 )/Distance(C , Cs) y C1 C C2 Cs

Purity of C1
n

x Fig. 12-10 WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

18

Color Models and Color Applications

Intuitive Color Concepts


n

Creating a color
n

Pick up a dominant color(pure color) and mixing color pigments with white and/or black
n n n

black white b/w

-> -> ->

shades tints tones

Color palette
n

Graphics packages often provide two or more color models

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

19

RGB Color Model


n

Principles
n n

Based on the tristimulus theory of vision The retina has peak sensitivities at 630nm(red), 530nm(green), and 450nm(blue) Used for displaying color on a video monitor C() = RR + GG + BB An additive model, see Fig. 12-11 and 12-12 See Fig. 12-13 and Table 12-1
20

n n

Application
n

Color representation, (R, G, B)


n n

Color gamut for NTSC standard RGB


n

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

10

Color Models and Color Applications

Fig. 12-11 The RGB color model, defining colors with an additive process within the unit cube
Gray Scale G Green(0, 1, 0) Cyan(0, 1, 1) Black(0, 0, 0) Yellow(1, 1, 0)

White(1, 1, 1) Red(1, 0, 0) R

Blue(0, 0, 1) B

Magenta (1, 0, 1)

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

21

Fig. 12-13 RGB Color Gamut for NTSC


y Cs

NTSC Standard R (0.670, 0.330) G (0.210, 0.710) B (0.140, 0.080)

x CIE Model Approx. Color Monitor Value (0.735, 0.265) (0.628, 0.346) (0.274, 0.717) (0.268, 0.588) (0.167, 0.009) (0.150, 0.070)

Table 12-1, RGB (x, y) chromacity coordinates WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME 22

11

Color Models and Color Applications

YIQ Color Model


n

Application
n

NTSC color model for television monitor


n

Composting video signal into a single signal

Representation
n

Y: luminance(brightness), i.e., a combination of red, green, and blue intensities


n

Y= 0.299R+0.587G+0.114B I= R- Y Q= B- Y

n n

I: orange-cyan hue information


n

Q: green-magenta hue information


n

Color model conversion

Y 0.299 0.587 0.144 R I =0.596 0.275 0.321=G Q 0.212 0.528 0.311 B

R 1.000 0.956 0.620Y G = 1.000 0.272 0.647 I B 1.000 1.108 1.705Q

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

23

CMY Color Model


n n

Application
n

Useful for describing color output to hard-copy devices Gray Scale a subtractive process (reflected light) M (Cyan, Magenta, Yellow) grays: equal amounts of CMY Magenta black: extra ink Red Black White Cyan C Green 24

Representation
n n n n

Blue

Color model conversion


R 1 C G = 1 M , B 1 Y

C 1 R M = 1 G Y 1 B

Yellow Y

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

12

Color Models and Color Applications

HSV Color Model


n

Representation
n n

Hue(H), Saturation(S), and Value(V) An intuitive color description by selecting a spectral color, and the amount of white and black added to obtain different shades, tints, and tones See Fig. 12-16 and -15 Saturation -> horizontal axis Value -> vertical axis Adding black decreases V while S in held constant Adding white decreases S while keeping V constant Adding B/W decreases both S and V

The HSV hexcone


n n n n n n

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

25

The HSV Hexcone


V(Value) Green(120) White Cyan R Blue(240) Yellow Red(0) Magenta

B RGB color cube Green Cyan Blue Magenta Color hexagon Black Yellow V White

Tints Tones Pure Hue (s=1, V=1)

H(Hue angle) S(Saturation)

Red

Shades

S 26

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

13

Color Models and Color Applications

HSV Color Model(Contd.)


n

Sufficient colors for human eye


n

Human eye can distinguish 82,720 different colors


n

128 different hues, 130 different tints, and 23 shades are discernible with yellow color and about 16 different shades at end of blue

Sufficient colors for graphic application


n

16, 384 colors are sufficient


n n

128 hues, 8 saturation levels, and 15 value setting i.e., 14 bits per pixel

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

27

Conversion RGB to HSV Models


G V(Value) Green(120) White B R RGB color cube Green Cyan Blue Yellow Red Magenta Color hexagon V= Max(r, g, b) S= Dist((r, g, b), diagonal axis) H= relative position within each sextant 28 H(Hue angle) S(Saturation) Cyan Blue(240) Yellow Red(0) Magenta

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

14

Color Models and Color Applications

Conversion RGB to HSV Models

Conversion HSV to RGB Models


const NO_HUE= -1 procedure rgbToHsv(real r, real g, real b) Assumes r, g, and b to be in [0, 1] Returns h, s, v in range [0, 1] begin max= max(r, max(g, b)) min= min(r, min(g, b)) delta= max- min v= max if (max!= 0.0) s= delta/max; else s= 0.0 if (s== 0.0) h= NO_HUE; else begin if (r== max) h= (g-b)/delta; else if (g== max) h= 2+ (b-r)/delta); else if (b== max) h= 4+ (r-g)/delta); h= h* 60.0; if (h< 0) h= h/360.0; end; end; 29

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

procedure hsvTo Rgb(real h, real s, real v) assumes h, s, and v to be in range [0, 1] Returns r, g, b in range [0, 1] begin if (s== 0){ // must be grayscale red= v; green= v; blue= v; } else { if (h==1.0) h= 0.0; h= h* 6.0; i= ffloor(h); f= h - i; a= v* (1-s); b= v*(1-(s*f)); c= v*(1-(s*(1-f))); case i of 0: red= v; green= c; blue= a; 1: red= b; green= v; blue= a; 2: red= a; green= v; blue= c; 3: red= a; green= b; blue= v; 4: red= c; green= a; blue= v; 5: red= v; green= a; blue= b; } end;

30

15

Color Models and Color Applications

L(lightness)

HLS Color Model


n

L= 1 (White)

Representation
n n

Hue(H), Lightness(L), and Saturation(S) The double-cone representation


n

Tektronix, see Fig. 12-18

Red Yellow Green

Magenta L=0.5 Cyan Blue

Pure hues -> L= 0.5

Gray Scale H(Hue angle) L= 0 (black) S(Saturation) 31

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

Color Selection and Applications

Harmonious color combinations


n n n

Select color from a small subspace of a color model Avoid displaying adjacent colors that differ widely in dominant frequency Limit display to a color formed with tints and shades, rather than with pure hues

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

32

16

Color Models and Color Applications

Summary
n

The basic properties of light


n

Dominant frequency(Hue), luminance(Brightness), and purity(Saturation) CIE XYZ -> hypothetical colors as the standard for defining all color combination
n

The concept of color models


n

compare color gamut, complementary color, dominant frequency and purity

n n n n

RGB -> video monitor CMY -> hardcopy devices YIQ -> television signal HSV and HLS -> Intuitive color models

Harmonious color combinations


33

WKTai/GAME Lab/CSIE/NDHU Color Models and Color Applications WKTai/GAME

17

Das könnte Ihnen auch gefallen