Lecture 8 - Images and Colors
Lecture 8 - Images and Colors
• Postscript/PDF:
• A typesetting language which includes text as
well as vector/structured graphics and bit-
mapped images.
• Used in several popular graphics programs
(Illustrator, FreeHand).
• Does not provide compression files are often
large.
Image formats (System Dependent)
• Windows (BMP):
• A system standard graphics file format for
Microsoft Windows.
• It is capable of storing 24-bit bitmap images.
• Used in PC Paintbrush and other programs.
Image formats (System Dependent)
• Macintosh (PAINT, PICT):
• PAINT was originally used in MacPaint
program, initially only for 1-bit monochrome
images.
• PICT format is used in MacDraw (a vector
based drawing program) for storing structured
graphics
Image formats (System Dependent)
• X-windows (XBM):
• Primary graphics format for the X-Window
system
• Supports 24-bit color bitmap
• Many public domain graphic editors, e.g., XV
• Used in X-Windows for storing icons, pixmaps,
backdrops, etc.
PNG File Format
• The Portable Network Graphics (PNG) format
was designed to replae th eolder and impler
GIF format and, to some extent, the much
more complex TIFF format.
PNG File Format
• The two-dimensional interlacing used in PNG does not
render the image faster than GIF, as a matter of fact
the rendering time of both formats is the same.
• However, PNG renders a small fraction of the total
image first and slowly refines the image in subsequent
passes until the entire image is rendered.
• Whereas interlaced GIF would render entire lines of
the image skipping neighboring lines and then coming
back in the subsequent passes to render skipped lines.
PNG File Format
• Advantages over GIF:
• Alpha channels (variable transparency)
• Also known as a mask channel, it is simply a way to
associate variable transparency with an image.
• Gamma correction (cross-platform control of image
brightness)
• Two-dimensional interlacing (a method of
progressive display)
• Better Compression (5-25% better)
Color in Images and Video
• Basics of Color
• Light and Spectra
• Visible light is an electromagnetic wave in the
400 nm – 700 nm range.
Color in Images and Video
• Most light we see is not one wavelength, it’s a
combination of many wavelengths.
• The graph shows the various wavelengths that make
up the visible spectrum and their amplitudes.
Color in Images and Video
• The Human Retina
• The eye functions on the same principle as a
camera
• Each neuron is either a rod or a cone.
• The rods contain the elements that are
sensitive to light intensities.
• Rods are not sensitive to color.
Color in Images and Video
• The Human Retina
• Cone come in 3 types: red, green and blue.
Each responds differently to various
frequencies of light.
• The following figure shows the spectral-
response functions of the cones and the
luminous-efficiency function of the human
eye.
Color in Images and Video
• The Human Retina
Color in Images and Video
• The Human Retina
• What we see in the picture is the sensitivity of
the human eye to each of the colors that
combine to form the various wavelengths of
visible light.
• We also note that the human eye is more
sensitive to the luminosity content or
brightness of the light than its color
components.
Color Composition
• A color can be specified as the sum of three
colors.
• So colors form a 3 dimensional vector space.
• The following figure shows the amounts of
three primaries needed to match all the
wavelengths of the visible spectrum.
Color Composition
Color Composition
• Lets now take a look at what is the
composition of the various wavelengths in
terms of the three components red blue and
green.
• This is different from the human perception or
sensitivity, this is simply the composition of
light.
Color Models for images
• RGB Additive Model
• CRT displays have three phosphors (RGB) which
produce a combination of wavelengths when
excited with electrons.
• A color image is a 2-D array of (R,G,B) integer
triplets.
• These triplets encode how much the
corresponding phosphor should be excited in
devices such as a monitor.
Color Models for images
• CMY Subtractive Model
• Cyan, Magenta, and Yellow (CMY) are
complementary colors of RGB.
• CMY model is mostly used in printing devices
where the color pigments on the paper absorb
certain colors (e.e., no red light is reflected
from cyan ink).
Color Models for images
• RGB Additive Model
Color Models for images
• CMY Subtractive Model
Color Models for Video
• YUV Model
• Human perception is more sensitive to
luminance (brightness) than chrominance
(color).
• Therefore, instead of separating colors, one
can separate the brightness information from
the color information.
Color Models for Video
• YUV Model
• Y is luminance
– Y = 0.299R + 0.5876G + 0.114B
• Chrominance is defined as the difference between a
color and a reference white at the same luminance.
• It can be represented by U and V – the color
differences
–U=B–Y
–V=R–Y
Color Models for Video
• YUV Model
• Eye is most sensitive to Y.
• Therefore, only error in the resolution of the
luminance (Y) is more important than the
chrominance (U, V) values.
• In PAL5 (or 5.5) MHz is allocated to Y, 1.3 HMz
to U and V.
• CD-I and DVI also use the YUV model.
Color Models for Video
• YIQ Model
• Although U and V nicely define the color
differences, they do not align with the desired
human perceptual color sensitivities.
• Hence, I and Q are used instead.
• I = 0.74 (R-Y) – 0.27 (B-Y)
• = 0.596R – 0.275G – 0.321B
• Q = 0.48(R-Y) + 0.41(B-Y)
= 0.212R – 0.523G + 0.311B
Color Models for Video
• YIQ Model
• YIQ is used in NTSC color TV broadcasting, it is
downward compatible with B/W TV where
only Y is used.
• Eye is most sensitive to Y, next to I, next to Q.
In NTSC broadcast TV. 4.2 MHz is allocated to
Y, 1.5 MHz to I, 0.55 MHz to Q.
Color Models for Video
Color summary
• Color images are encoded as triplets of values.
• RGB is an additive color model that is used for
light-emitting devices, e.g., CRT displays.
• CMY is a subtractive model that is used often for
printers.
• Sometimes, on 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.
Color summary
• Two common color models in imaging are RGB
and CMY, two common color models in video are
YUV and YIQ.
• YUV uses properties of the human eye to
prioritize information.
• Y is the black and white (luminance) image, U
and V are the color difference (chrominance)
images.
• YIQ uses similar idea.