0% found this document useful (0 votes)
16 views28 pages

CO4 Color Models

The document discusses various color models used in image processing, including RGB, CMY, HSV, HLS, and YIQ, highlighting their applications in digital and print media. It explains the fundamental concepts of color perception, including brightness, hue, and saturation, as well as techniques like gamma correction, halftoning, and dithering for image representation. The document emphasizes the importance of color models in simplifying object identification and enhancing visual communication across different platforms.

Uploaded by

shoaib9122004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views28 pages

CO4 Color Models

The document discusses various color models used in image processing, including RGB, CMY, HSV, HLS, and YIQ, highlighting their applications in digital and print media. It explains the fundamental concepts of color perception, including brightness, hue, and saturation, as well as techniques like gamma correction, halftoning, and dithering for image representation. The document emphasizes the importance of color models in simplifying object identification and enhancing visual communication across different platforms.

Uploaded by

shoaib9122004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Color Models

Why Color Models?


• Color is a powerful descriptor which simplifies object identification and
extraction from a scene.
• Color image processing is divided into two major areas:
• Full-color processing
• Pseudo-color processing.
• In full color processing, the images are acquired with a full-color sensor,
such as a color TV camera or color scanner.
• In pseudo-color processing, the problem is one of assigning a color to a
particular monochrome intensity or range of intensities.
• Color image processing techniques are used in a broad range of applications,
including publishing, visualization, and the Internet.
Color Fundamentals (1/7)
• In figure, visible light is composed of a relatively narrowband of frequencies
in the electromagnetic spectrum.
• A body that reflects light is balanced in all visible wavelengths appears white
to the observer.
• For example, green objects reflect light with wavelengths primarily in the
500 to 570 nm range while absorbing most of the energy at other
wavelengths.
Color Fundamentals (2/7)
• If the light is achromatic, its only attribute is its intensity. Achromatic light is
what viewers see on a black and white television set.
• Chromatic light spans the electromagnetic spectrum from approximately400
to 700 nm.
• Three basic quantities are used to describe the quality of a chromatic light
source: radiance, luminance, and brightness.
• Radiance is the total amount of energy that flows from the light source, and it
is usually measured in watts (W).
• Luminance, measured in lumens (Im), gives a measure of the amount of
energy an observer perceives from a light source.
• Brightness is a subjective descriptor that is practically impossible to measure.
It embodies the achromatic notion of intensity and is one of the key factors in
describing color sensation.
• Intensity is determined by the actual amount of light, with more light
corresponding to more intense colours.
Color Fundamentals (3/7)
• The CIE (the International Commission on Illumination) designated in 1931 the
following specific wavelength values to the three primary colors:-
• Blue=435.8 nm
• Green=546.1 nm
• Red= 700 nm.
• The primary colors can be secondary added to produce the colors of light –
• Magenta (R + B)
• Cyan (G + B)
• Yellow (R + G)
• Mixing the three primaries, or a secondary with its opposite primary color, in the
right intensities produces white light. i.e., R+G+B = W
• Achromatic light has no color - its only attribute is quantity or intensity. Grey-level
is a measure of intensity. The intensity is determined by the energy, and is therefore
a physical quantity. On the other hand, brightness or luminance is determined by the
perception of the color, and is therefore psychological.
Color Fundamentals (4/7)
• A primary color is defined as one
that subtracts or absorbs a primary
color of light and reflects or
transmits the other two.
• Therefore, the primary colors of
pigments are magenta, cyan, and
yellow, and the secondary colors are
red, green, and blue.
• A proper combination of the three
pigment primaries, or a secondary
with its opposite primary, produces
black.
Color Fundamentals (5/7)
• The characteristics generally used to distinguish one color from another are
brightness, hue, and saturation.
• Brightness embodies the achromatic notion of intensity.
• Hue is an attribute associated with the dominant wavelength in a mixture of light
waves. It represents dominant color as perceived by an observer. Thus, when we
call an object red, orange, or yellow, we are referring to its hue.
• Saturation refers to the relative purity or the amount of white light mixed with a
hue.
• Colors such as pink (red and white) and lavender (violet and white) are less
saturated, with the degree of saturation being inversely proportional to the amount
of white light added.
• Hue and Saturation taken together are called chromaticity, and, therefore, a color
may be characterized by its brightness and chromaticity.
Color Fundamentals (6/7)
• The amounts of red, green, and blue needed to form any particular color
are called the tristimulus values and are denoted, X, Y. and Z.
respectively.

• A color is then specified by its trichromatic coefficients, defined as


x = X/ (X+Y+Z)
y = Y / (X+Y+Z)
z = Z/ (X+Y+Z)
It is noted from these equations that
x+y+z=1
RGB- Color Model (1/2)
• The RGB color model is one of the most widely used color representation method in
computer graphics. It use a color coordinate system with three primary colors:
R(red), G(green), and B(blue).
• Each primary color can take an intensity value ranging from 0 (lowest) to 1 (highest).
• Mixing these three primary colors at different intensity levels produces a variety of
colors. The collection of all the colors obtained by such a linear combination of red,
green and blue forms the cube shaped RGB color space.
• The corner of RGB color cube that is at the origin of the coordinate system
corresponds to black, whereas the corner of the cube that is diagonally opposite to
the origin represents white. The diagonal line connecting black and white
corresponds to all the gray colors between black and white, which is also known
as gray axis.
• In the RGB color model, an arbitrary color within the cubic color space can be
specified by its color coordinates: (r, g, b)
RGB- Color Model (1/2)

• Example:
(0, 0, 0) for black,
(1, 1, 1) for white,
(1, 1, 0) for yellow,
(0.7, 0.7, 0.7) for gray
so on….
CMY- Color Model (1/2)
• If we subtract red from white, what remains consists of green and blue which is
cyan.
• The complementary color of red light is cyan light. This is reasonable since
cyan light is equivalent to a combination of blue and green light; and blue and
green light when added to red light will produce white light.
• Thus, red light and cyan light (which is equivalent to blue + green light)
represent a pair of complementary colors of light; they add together to produce
white light. So, R + C = R + (B + G) = White
• The coordinate system of CMY model use the three primaries’ complementary
colors: C(cyan), M(magenta) and Y(yellow)
• The corner of the CMY color cube that is at (0, 0, 0) corresponds to white,
whereas the corner of the cube that is at (1, 1, 1) represents black.
CMY- Color Model (2/2)
• The conversion between RGB and CMY color
models:
RGB vs. CMY Color Model (1/2)
RGB Color Model CMY Color Model
Used for digital works. Used for print works.

Primary colors: Red, Green, Blue Primary Colors: Cyan, Magenta, Yellow, Black

Additive Type Mixing Subtractive Type Mixing.

Colors of images are more vibrant Colors of lass vibrant.

CMYK has lesser range of colors than RGB.


RGB Scheme has wider range of colors than CMYK
file formats:- JPEG, PNG, GIF etc. file formats:- PDF, EPS etc

Basically it is used for online logos, online ads, Basically it is used for business cards, stationary,
digital graphics, photographs for website, social stickers, posters, brochures etc.
media, or apps etc.
RGB vs. CMY Color Model (2/2)
HSV- Color Model (1/2)
• HSV: The image consists of three channels: Hue, Saturation and Value (brightness)
• This color model does not use primary colors directly. It uses color in the way
humans perceive them. HSV color is represented by a cone.
• It is a hex-cone subset of the cylindrical coordinate system. The human eye can see
128 different hues, 130 different saturations and number values between 16 (blue)
and 23 (yellow).
• Hue is a color component. Since the cone represents the HSV model, the hue
represents different colors in different angle ranges.
• HSV model is used in histogram equalization and converting grayscale images to
RGB color images.
• Saturation as the name suggest describes the percentage of the color. Sometimes
this value lies in the 0 to 1 range. 0 being the grey and 1 being the primary color.
Saturation describes the grey color.
• The value (brightness) represents the intensity of the color chosen. Its value lies in
percentage from 0 to 100. 0 is black and 1 is the brightest and reveals the color.
HSV- Color Model (2/2)
• Red colour falls between 0 and 60 degrees in
the HSV cone.
• Yellow colour falls between 61 and 120
degrees in the HSV cone.
• Green colour falls between 121 and 180
degrees in the HSV cone.
• Cyan colour falls between 181 and 240
degrees in the HSV cone.
• Blue colour falls between 241 and 300
degrees in the HSV cone.
• Magenta colour falls between 301 and 360
degrees in the HSV cone.
HLS- Color Model (1/2)
• HLS stands for Hue, Light, and Saturation. It
is a double hex-cone subset. The maximum
saturation of hue is S =1 and L= 0.5. It is
conceptually easy for people who want to
view white as a point.
• The HLS model is almost identical to the
HSV model except that a double hex-cone is
used instead of an inverted hex-cone.
• Neither HLS nor HSV has an intensity value
that compensates for the relative difference in
perceived brightness of red, green, and blue
of the human eye, so if you create colors of
constant HLS lightness or HSV value, they do
not appear equally bright.
YIQ- Color Model (1/2)
• YIQ: It is most widely used color model in Television broadcasting.
• Y stands for luminance part and IQ stands for chrominance part.
• In the black and white television, only the luminance part (Y) was
broadcast. The Y value is similar to the grayscale part.
• The color information is represented by the IQ part.
• YIQ model is used in the conversion of grayscale images to RGB
color images.
YIQ- Color Model (2/2)
• The conversion from RGB to YIQ and vice-versa are followed by:
Gamma Correction (1/2)
• The term gamma correction means doing graphics color math
accounting for the distortion that the color will eventually go through
when displayed on a monitor.
• Instead, the input value is effectively raised to an exponent called
gamma.
• Gamma correction is used to correct the differences between the way a
camera captures content, the way a display displays content, and the
way our visual system processes light.
• Gamma correction controls the overall brightness of an image. Images
which are not properly corrected can look either bleached out, or too
dark.
Gamma Correction (2/2)
• Our eyes do not perceive light the way cameras do. With a digital
camera, when twice the number of photons hit the sensor, it
receives twice the signal (a "linear" relationship). Pretty logical,
right? That's not how our eyes work. Instead, we perceive twice
the light as being only a fraction brighter — and increasingly so
for higher light intensities (a "nonlinear" relationship)
• Gamma encoded images store tones more efficiently. Since gamma encoding redistributes tonal
levels closer to how our eyes perceive them, fewer bits are needed to describe a given tonal range.
Otherwise, an excess of bits would be devoted to describe the brighter tones (where the camera is
relatively more sensitive), and a shortage of bits would be left to describe the darker tones (where
the camera is relatively less sensitive):
Example: Gamma Correction
• Almost every computer monitor, from whatever manufacturer, has one thing
in common. They all have a intensity to voltage response curve which is
roughly a 2.5 power function. It means that if you send your computer
monitor a message that a certain pixel should have intensity equal to x, it will
actually display a pixel which has intensity equal to x ^ 2.5, because the range
of voltages sent to the monitor is between 0 and 1, this means that the
intensity value displayed will be less than what you wanted it to be. (0.5 ^ 2.5
= 0.177 for example) monitors, then, are said to have a gamma of 2.5
Halftoning (1/2)
• The process of generating a binary pattern of black and white dots from an image is termed halftoning.
• The human visual system has a tendency to average brightness over small areas, so the black dots and
their white background merge and are perceived as an intermediate shade of grey.
• The process of generating a binary pattern of black and white dots from an image is termed half toning.
• In traditional newspaper and magazine production, this process is carried out photographically by
projection of a transparency through a 'halftone screen' onto film.
• The screen is a glass plate with a grid etched into it.
• Different screens can be used to control the size and shape of the dots in the halftoned image.
• A fine grid, with a 'screen frequency' of 200-300 lines per inch, gives the image quality necessary for
magazine production.
• A screen frequency of 85 lines per inch is deemed acceptable for newspapers.
• In computer graphics, half toning reproductions are approximated using rectangular pixel region say 2
x 2 pixels or 3 x 3 pixels.
• These regions are called as “Halftone Patters” or “Pixel Patterns”.
Halftoning (2/2)
Halftoning - Moire Patterns
• Repeated use of same dot pattern
for particular shade results in
repeated pattern.
• Perceived as a moire pattern.
• Instead, randomize halftone
pattern.
Dithering
• Another technique for digital half toning is dithering.
• Dithering can be accomplished by thresholding the image against a dither matrix.
• It is the technique for approximating halftones without reducing resolution, as pixel grid patterns do.
• The first two dither matrices, rescaled for application to 8-bit images, are:

• The elements of a dither matrix are thresholds.


• The matrix is laid like a tile over the entire image and each pixel value is compared with the
corresponding threshold from the matrix.
• The pixel becomes white if its value exceeds the threshold or black otherwise.
• This approach produces an output image with the same dimensions as the input image, but with less
detail visible.
Algorithm to halftone an image using a Dither matrix

for all x & y do


if f(x,y) > m(x,y) then
g(x,y) = white
else
g(x,y) = black
end if
End for
Patterning
• A simple digital halftoning technique
known as patterning involves replacing
each pixel by a pattern taken from a 'binary
font’.
• Such a font, can be made up of ten 3 x 3
matrices of pixels.
• This font can be used to print an image
consisting of ten grey.
• A pixel with a grey level of 0 is replaced by
a matrix containing no white pixels; a pixel
with a grey level of 1 is replaced by a
matrix containing a single white pixel; and
so on.
• Note that, since we are replacing each pixel
by a 3 x 3 block of pixels, both the width
and the height of the image increase by a
factor of 3.

You might also like