EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

42
EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501

Transcript of EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Page 1: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

EEL 5771-001Introduction to Computer

Graphics

PPT12: Color modelsYamini Bura – U66775501

Page 2: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

NOTHING CAN BE OVERLOOKED THE WAY THAT COLOR CAN!!!

Page 3: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Color

Color has three essential elements must be present:

•light

•an illuminated object

•and an observer

Page 4: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Visible Spectrum We perceive electromagnetic energy having wavelengths

in the range 400-700 nm as visible light.

Page 5: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

WHITE LIGHT

The color spectrum shows the range of wavelengths of energy that are visible to the human eye. Variation in wavelengths alters the colors we see.

Page 6: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Light and Color

The frequency ( or mix of frequencies ) of the light determines the color.

The amount of light(sheer quantity of photons ) is the intensity. Three independent quantities are used to describe any particular color. : hue, saturation, and lightness or brightness or intensity.

•The hue is determined by the dominant wavelength.(the apparent color of the light)

When we call an object "red," we are referring to its hue. Hue is determined by the dominant wavelength.

Physical mix of opaque paints

Primary: RYB

Secondary: OGV

Neutral: R + Y + B

Hue paint Mixing

Page 7: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

•The saturation is determined by the excitation purity , and depends on the amount of white light mixed with the hue. A pure hue is fully saturated, i.e. no white light mixed in. Hue and saturation together determine the chromaticity for a given color.Saturation is the purity of the color

•Lightness or brightness refers to the amount of light the color reflects or transmits.Finally, the intensity is determined by the actual amount of light, with more light corresponding to more intense colors ( the total light across all frequencies).

Page 8: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Physiology of Color

Light waves that reach the eye stimulate a visual process so complex it's not yet fully understood. Within the retina, cones respond to color hues and brightness. Rods sense only brightness. Three types of cones respond to wavelengths in ways that produce all the colors we see.

Page 9: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Physiology of Color

3 cone response curves Luminance efficiency

The response of each type of cone as a function of the wavelength of the incident light is shown in figure. The peaks for each curve are at 440nm (blue), 545nm (green) and 580nm (red). Note that the last two actually peak in the yellow part of the spectrum.

Page 10: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

LIGHT AND THE EYES

• The color signal to the brain comes from the response of the 3 cones to the spectra being observed. That is, the signal consists of 3 numbers: R, G, and B

• A color can be specified as the sum of three colors. So colors form a 3 dimensional vector space.

• These three hues: red, green, and blue are called primary colors

Page 11: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Color Matching In order to define the perceptual 3D space in a "standard" way, a set of experiments can (and have been) carried by having observers try and match color of a given wavelength, lambda, by mixing three other pure wavelengths, such as R=700nm, G=546nm, and B=436nm in the following example. Note that the phosphorus of color TVs and other CRTs do not emit pure red, green, or blue light of a single wavelength, as is the case for this experiment.

                                  

Page 12: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

COLOR MODELS Color models provide a standard way to specify a particular color, by defining a 3D coordinate system, and a subspace that contains all constructible colors within a particular model. Any color that can be specified using a model will correspond to a single point within the subspace it defines. Each color model is oriented towards either specific hardware (RGB,CMY,YIQ), or image processing applications (HSI).

Page 13: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE Chromaticity diagramIn 1931, the CIE defined three standard primaries (X, Y, Z). The Y primary was intentionally chosen to be identical to the luminous-efficiency function of human eyes.

•The above figure shows the amounts of X, Y, Z needed to exactly reproduce any visible color.

ZYX ZYXC

Page 14: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE Color Space In order to achieve a representation which uses only positive mixing coefficients, the CIE ("Commission Internationale d'Eclairage") defined three new hypothetical light sources, x, y, and z, which yield positive matching curves:

If we are given a spectrum and wish to find the corresponding X, Y, and Z quantities, we can do so by integrating the product of the spectral power and each of the three matching curves over all wavelengths. The weights X,Y,Z form the three-dimensional CIE XYZ space, as shown below.

Page 15: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE CHROMATICITY COORDINATES

The red chromaticity coordinate is given by x and the green chromaticity coordinate by y. The tristimulus values are linear in I() and thus the absolute intensity information has been lost in the calculation of the chromaticity coordinates {x,y}. All color distributions, I(), that appear to an observer as having the same color will have the same chromaticity coordinates.

Page 16: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

Figure : The CIE Chromaticity Diagram showing all visible colors. x and y are the normalized amounts of the X and Y primaries present, and hence z = 1 - x

- y gives the amount of the Z primary required.

Page 17: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE Color Cone

Page 18: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE Typical Display Gamut

Measuring color allows us to compare the color gamut, or range of colors produced by different methods.

We find that color transparency film produces a wide range of colors including some a monitor cannot display.

Digital color printers and printing presses have different color gamuts

Page 19: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE Lu*v* and Lab Perceptually Uniform

Spaces

Lu*v* rescales xyY Lab color opponents

Page 20: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CIE Color Matching Functions

CIE RGB Matching Functions CIE XYZ Matching Functions

Page 21: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

RGB Color Wheel

• Warm/Cool• Complements • Split Complement• Analogous• Show RGB Cube

Page 22: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

THE RGB COLOR CUBE The additive color model used for computer graphics is represented by the RGB color cube, where R, G, and B represent the colors produced by red, green and blue phosphorus, respectively.

Page 23: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

THE RGB MODEL

This is an additive model, i.e. the colors present in the light add to form new colors, and is appropriate for the mixing of colored light for example

The RGB model is used for color monitors and most video cameras.

The figure on the left shows the additive mixing of red, green and blue primaries to form the three secondary colors yellow (red + green), cyan (blue + green) and magenta (red + blue), and white ((red + green + blue).

The figure on the right shows the three subtractive primaries, and their pair wise combinations to form red, green and blue, and finally black by subtracting all three primaries from white.

Page 24: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

THE RGB COLOR CUBEThe color cube sits within the CIE XYZ color space as follows.

Page 25: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

RGB from Spectrum

RGB = x d

Page 26: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

XYZ from Spectrum

XYZ = x d

Page 27: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

RGB COLOR MODEL FOR CRT DISPLAYS

•CRT displays have three phosphors (RGB) which produce a combination of wavelengths when excited with electrons.

Page 28: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CMY COLOR MODEL

•Cyan, Magenta, and Yellow (CMY) are complementary colors of RGB. They can be used as Subtractive Primaries.

•CMY model is mostly used in printing devices where the color pigments on the paper absorb certain colors (e.g., no red light reflected from cyan ink).

Page 29: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

CONVERSION BETWEEN RGB AND CMY

•Convert White from (1, 1, 1) in RGB to (0, 0, 0) in CMY:

•Sometimes, an alternative CMYK model (K stands for Black) is used in color printing (e.g., to produce darker black than simply mixing CMY).

K := min (C, M, Y), C := C - K, M := M - K, Y := Y - K.

Page 30: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

COLOR GAMUTS The chromaticity diagram can be used to compare the "gamuts" of various possible output devices (i.e., monitors and printers). Note that a color printer cannot reproduce all the colors visible on a color monitor

Page 31: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

COLOR PRINTING Green paper is green because it reflects green and absorbs other wavelengths. The following table summarizes the properties of the four primary types of printing ink.

dye color

absorbs

reflects

cyan red blue and greenmagen

tagreen blue and

redyellow blue red and greenblack all none

To produce blue, one would mix cyan and magenta inks, as they both reflect blue while each absorbing one of green and red. Unfortunately, inks also interact in non-linear ways. This makes the process of converting a given monitor color to an equivalent printer color a challenging problem.

Black ink is used to ensure that a high quality black can always be printed, and is often referred to as to K. Printers thus use a CMYK color model.

Page 32: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

COLOR CONVERSION To convert from one color gamut to another is a simple procedure. Each phosphor color can be represented by a combination of the CIE XYZ primaries, yielding the following transformation from RGB to CIE XYZ:

The transformation yields the color on monitor 2 which is equivalent to a given color on monitor 1. Conversion to-and-from printer gamuts is difficult. A first approximation is as follows: C = 1 - RM = 1 - GY = 1 – B

The fourth color, K, can be used to replace equal amounts of CMY:

K = min(C,M,Y) C' = C - KM' = M - KY' = Y - K

Page 33: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

The YIQ (luminance-inphase-quadrature) model is a recoding of RGB for color television, and is a very important model for color image processing. The importance of luminance was discussed .

The conversion from RGB to YIQ is given by:

The luminance (Y) component contains all the information required for black and white television, and captures our perception of the relative brightness of particular colors. That we perceive green as much lighter than red, and red lighter than blue, is indicated by their respective weights of 0.587, 0.299 and 0.114 in the first row of the conversion matrix above. These weights should be used when converting a color image to greyscale if you want the

perception of brightness to remain the same.

Page 34: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

THE YIQ MODEL Figure: Image (a) shows a color test pattern, consisting of horizontal stripes of black, blue, green, cyan, red, magenta and yellow, a color ramp with constant intensity, maximal

saturation, and hue changing linearly from red through

green to blue, and a greyscale ramp from

black to white. Image (b) shows the intensity for image (a). Note how much detail is lost. Image

(c) shows the luminance. This third

image accurately reflects the

brightness variations perceived in the original image

Page 35: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

HSV Color Model

HSV is a projection of the RGB space

RGB cube HSV top view HSV cone

Page 36: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

HSV Color Model

Hue, an angular measure (0 … 360)

Page 37: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

HSV Color Model

Saturation, a fractional measure (0.0 … 1.0)

Page 38: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

HSV Color Model

Value, a fractional measure (0.0 … 1.0)

Page 39: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

HSV COLOR MODEL

This color model is based on polar coordinates, not Cartesian coordinates.

HSV is a non-linearly transformed (skewed) version of RGB cube Hue: quantity that distinguishes color family, say red from

yellow, green from blue Saturation (Chroma): color intensity (strong to weak). Intensity

of distinctive hue, or degree of color sensation from that of white or grey

Value (luminance): light color or dark color

Page 40: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

THE HSI MODEL As mentioned above, color may be specified by the three quantities hue, saturation and intensity. This is the HSI model, and the entire

space of colors that may be specified in this way is shown in figure .

Page 41: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

THE HSI MODEL

Figure : The HSI model, showing the HSI solid on the left, and the HSI triangle on the right, formed by taking a horizontal slice through the HSI solid at a particular intensity. Hue is measured from red, and saturation is given by distance from the axis. Colors on the surface of the solid are fully saturated, i.e. pure colors, and the greyscale spectrum is on the axis of the solid. For these colors, hue is undefined.

Page 42: EEL 5771-001 Introduction to Computer Graphics PPT12: Color models Yamini Bura – U66775501.

color is a perceptual phenomenon