Unit-4 Illumination & Colour Models
Unit-4 Illumination & Colour Models
SHADING
Illumination Models and Shading
• Light Source Models
• Ambient Illumination
• Diffuse Reflection
• Specular Reflection
• Polygon Rendering Methods
• Flat Shading
• Gouraud Shading
• Phong Shading
Illumination Model Parameters
•Lighting effects are described with models that consider the
interaction of light sources with object surfaces
• OpenGL default
Ambient Illumination
• Example:
Ambient Illumination
• The reflected intensity Iamb of any point on the
surface is:
Iamb = Ka Ia
Ia - ambient light intensity
Ka [0,1] - surface ambient reflectivity
cos()
Diffuse Reflection
• Brightness is proportional to cos() because a
surface (a) perpendicular to the light direction is
more illuminated than a surface (b) at an oblique
angle
a b
L
N
Diffuse Reflection
• The reflected intensity Idiff of a point on the
surface is:
0.3
0.5
0.7
Ka
Specular Reflection
• Models shiny and glossy surfaces (like metal,
plastic, etc..) with highlights
• Reflectance intensity changes with reflected
angle
• An ideal specular surface (mirror) reflects light
exclusively in one direction: R
• Glossy objects are not ideal mirrors and reflect
in the immediate
N vicinity of R N
L R L
V
R
Specular surface
Specular Reflection
• The Phong Model: plots of cosn() for three
values of the specular parameter n
1
n=1
0.8
n=8
N
n=64
0.6 L
R
V
0.4
0.2
Specular surface
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Specular Reflection
•The illumination equation combined with diffuse
reflection is:
I = Iamb+Idiff+Ispec=
Ka Ia + Ip (Kd NL + Ks (RV)n)
0.3
0.7
Kd
Specular Reflection
• Example: effects of the specular parameter n
n=50
n=10
n=3
Specular
• Example:
Reflection
Ambient Illumination
Ambient + Diffuse
N k
k
Gouraud Shading
• Interpolation of the vertex intensities
y
I3
I1 IP
scan line
I4 I5
I2
x
y y y y
I4 4 2
I1 1 4
I2
y 1 y 2 y 1 y 2
y y y
I5 5 2
I3 3 5
I2
y 3 2
yy 3 y 2
y
x
Ip 5
xx
p
I4 x p 4
I5
xx 5 4 x 5 x 4
Gouraud Shading
• Example: Gouraud shading of a sphere
Phong Shading
Flat
Gouraud
Phong
Polygon Rendering Methods
• Example:
Flat
Gouraud
Phong
Polygon Rendering Methods
• Example:
Flat Gouraud
Phong
Computer Graphics
Color Models
38
Outline:
Properties of Light
Color Models
Standard primaries and the chromaticity diagram
The RGB color model
The YIQ and related color model
The HSV color model
The HSL Color model
The CMY and CMYK Color models
Color Models Applications
Dithering VS Half-toning 39
Properties of Light
FIGURE-1
Each frequency value within the visible region of the electromagnetic spectrum
corresponds to a distinct spectral color.
40
Properties of Light
• When white light is incident on an opaque object , some frequencies
are reflected and some are absorbed.
• The combination of frequencies present in the reflected in the
reflected light determines the color of the object that we see.
(Dominant frequency or Hue)
41
Properties of Light
•
Period (T)
42
Characteristics of Color
2. Brightness
The total light energy, how bright is the color (How bright
are the lights illuminating the object?)
3. Purity (Saturation)
Purity describes how close a light appears to be to a pure
spectral color, such as pink is less saturated than red.
44
Color Model
Primary Colors
Sets of colors that can be combined to make a useful range of
colors
Color Gamut
Set of all colors that we can produce from the primary colors.
Complementary Colors
Pairs of colors which, when combined in the right proportions,
produce white.
Example, in the RGB model: red & cyan , green & magenta , blue
& yellow.
• No finite set of real primary colors can be combined to produce all possible
visible colors.
• However, given a set of three primary colors, we can characterize any fourth
color using color-mixing processes.
45
Color Model
Shades , Tints & Tones
• A shade is produced by “dimming ” a hue.[Adding black].
Dark Blue = pure blue + black
• Tone refers to the effects of reducing the "colorfulness" of a hue. [adding gray] or
[adding black & white].
Additive color
Uses light to display color. Mixing begins with black and ends with white; as more
color is added, the result is lighter and tends to white. Used for computer displays
Example: The RGB colors are light primaries and colors are created with light.
A subtractive color
Uses ink to display color. Mixing means that one begins with white and ends with
black; as one adds color, the result gets darker and tends to black. Used for printed
material
It is called 'subtractive' because its wavelength is less than sum of the wavelengths
of its constituting colors.
Example: The CMYK color system is the color system used for printing. 47
Standard Primaries & the chromaticity diagram
• This is an international standard for primary colors
established in 1931.
48
Standard Primaries & the chromaticity diagram
Color-matching functions
A color in the
vicinity of
500nm can be
matched only
but subtracting
an amount of
red light from a
combination of
blue and green
lights.
49
Standard Primaries & the chromaticity diagram
50
Standard Primaries & the chromaticity diagram
To define a color in CIE model, provide weights for
the X, Y and Z primaries, just as you would for an
RGB display (e.g. color = xX + yY + zZ).
51
CIE chromaticity diagram.
Standard Primaries & the chromaticity diagram
Gamut Color
Complementary Color Dominant Wavelength
&
Purity
RGB Model 52
RGB Model
• The red, green, and blue (RGB) color space
is widely used throughout computer
graphics.
54
YIQ model
55
YIQ model
• A color television set would take these three channels, Y, I, and Q, and
map the information back to R, G, and B levels for display on a screen.
56
HSV Model
57
HSV Model
58
HSV Model
The Saturation (S) of a color describes how white the color is.
Or the amount of white added to the color. A pure red is fully
saturated (S=1) means no white added
59
HSV Model
60
HSL Model
• Double-cone Representation
Parameters are :
• Hue (H)
• Lightness (L)
• Saturation (S)
61
HSL Model
• Vertical Axis is called Lightness(L).
• At L=0 we have black , and at L=1 we have white
• Grayscale values are along the L axis
• The pure colors lie at the axis where L=0.5 and S=1.0
62
CMY and CMYK Model
63
CMY and CMYK Model
In additive color models such as RGB, white is the “additive”
combination of all primary colored lights, while black is the absence
of light.
In the CMYK model, it is the opposite: white is the natural color of the
paper or other background, while black results from a full
combination of colored inks.
RGB To CMY CMY To RGB
64
CMY and CMYK Model
CMYK Color Model
Although cyan, magenta and yellow inks might be expected be sufficient for
color printing, most actual color printing uses black ink in addition.
This is partly because a mixture of the first three inks may not yield a black
that is neutral enough, or dark enough, but also because the use of black
spares the use of the more expensive colored inks, and also reduces the total
amount of ink used, thus speeding drying times.
- Computer graphics
- Image processing
RGB - Image Analysis
- Image Storage
CMY(K) Printing
- Human visual perception
- Computer graphics processing
- Computer Vision
- Image Analysis
- Design image
HSV, HSL - Human vision
- Image editing software
- Video editor
- TV broadcasting
YIQ - Video system
Halftone
• A technique used in newspaper printing
Only two intensities are possible, blob of ink and no blob of
ink. But, the size of the blob can be varied
67
Dithering
68
Halt-Toning Vs. Dithering
Half toning is the reproduction of grayscale images using dots
but with varying size.
Typical Application Laser printer.
69