Image Color
Image Color
Yao Wang
Polytechnic University, Brooklyn, NY11201
http://eeweb.poly.edu/~yao
Outline
Color images with figure captions in this and following slides are from [Gonzalez02]
• Illuminating sources:
– emit light (e.g. the sun, light bulb, TV monitors)
– perceived color depends on the emitted freq.
– follows additive rule: R+G+B=White
• Reflecting sources:
– reflect an incoming light (e.g. the color dye, matte surface,
cloth)
– perceived color depends on reflected freq (=emitted freq-
absorbed freq.)
– follows subtractive rule: R+G+B=Black
From http://www.stlukeseye.com/Anatomy.asp
Ci = ∫ C (λ )ai (λ )dλ , i = r , g , b, y
Green Blue
Color Specification
G
R
Some important color coordinates (RGB, CMY, XYZ, YIQ, etc) can be
converted from each other using linear conversion
• For natural images we need a light source (λ: wavelength of the source) ? .
– E(x, y, z, λ): incident light on a point (x, y, z world coordinates of the point)
• Each point in the scene has a reflectivity function.
– r(x, y, z, λ): reflectivity function
• Light reflects from a point and the reflected light is captured by an imaging device.
– c(x, y, z, λ) = E(x, y, z, λ) × r(x, y, z, λ): reflected light.
ψ R ,G , B ( X, t ) = ∫ C ( X, t , λ )aR ,G , B (λ )dλ
• A color camera has three color filters
• a R,G,B reflects the frequency response of each color filter
ψ R ,G , B (x, t ) = ψ R ,G , B ( X, t )
X 3-D
point Z
Y
C
y
F Camera
x
center
X Y
x=F ,y=F
Z Z
x
y
x The image of an object is reversed from its
2-D
3-D position. The object appears smaller
Image image
when it is farther away.
plane
Input Output
0
1
…
255
• Display:
– Need three light sources projecting red, green, blue
components respectively at every pixel. This is realized by
exciting the phosphors behind the screen with electronic
beams with appropriate intensity. There are three types of
phosphors, one for each color.
– Analog display: electronic beams cover the entire screen by
raster scan
– Digital display: directly exiciting at all pixel locations
• Printing:
– Need three (or more) color dyes (Cyan, Magenta, Yellow, and
Black)
– Out of gamut color: replaced by the nearest color
Each color model has different color range (or gamut). RGB model has a larger gamut than CMY.
Therefore, some color that appears on a screen may not be printable and is replaced by the closest
color in the CMY gamut.
• Select a set of colors that are most frequently used in an image, save
them in a look-up table (also known as color map or color palette)
• Any color is quantized to one of the indexed colors
• Only needs to save the index as the image pixel value and in the display
buffer
• Typically: k=8, m=8 (selecting 256 out of 16 million colors)
Input index (k bits) Red color (m bits) Green color (m bits) Blue color (m bits)
Index 1 … … …
……. … … …
Index 2^k … … …
Uniform quantization
(3 bits for R,G, 2 bits for B)
These colors are those that can be rendered consistently by different computer systems. They are obtained
by quantizing the R,G,B component independently using uniform quanitization. Each component is
quantized to 6 possible values: 0, 51, 102, 153, 204, 255.
• Color quantization may cause contour effect when the number of colors
is not sufficient
• Dithering: randomly perturb the color values slightly to break up the
contour effect
– fixed pattern dithering
– diffusion dithering (the perturbed value of the next pixel depends on the
previous one)
– Developed originally for rendering gray scale image using black and white ink
only
Original
Dithered
value
value
(R,G, or B)
Dithering
value
8 bit uniform
without dithering
Demo Using Photoshop
• Why?
– Human eye is more sensitive to changes in the color hue than
in brightness.
• How?
– Use different colors (different in hue) to represent different
image features in a monochrome image.
– Intensity slicing: Display different gray levels as different
colors
• Can be useful to visualize medical / scientific / vegetation
imagery
• E.g. if one is interested in features with a certain intensity range
or several intensity ranges
– Frequency slicing: Decomposing an image into different
frequency components and represent them using different
colors.
©Yao Wang, 2006 EE3414: Color 31
Intensity Slicing
Color
C4
C3
C2
C1
f0 =0 f1 f2 f3 f4 Gray level
Pixels with gray-scale (intensity) value in the range of (f i-1 , fi) are rendered with color Ci