Assignment of Digital Image Processing
Bachelor of Science (Computer Science)
Session (2020-2024)
Submitted By:
Anoosha Rehman 2023110061
Submitted To:
Ma’am Bushra
Subject
Digital Image Processing
DEPARTMENT OF COMPUTER SCIENCE
GOVT POST GRADUATE COLLEGE (W) SAMNABAD, LAHORE
AFFILIATED WITH
LAHORE COLLEGE FOR WOMEN UNIVERSITY LAHORE
Color Images
In automated image analysis, color is a powerful descriptor, which simplifies object identification
and extraction. The human eye can distinguish between thousands of color shades and intensities
but only about 20-30 shades of gray. Hence, the use of color in human image processing would be
very effective. Color image processing consists of two parts: Pseudo-color processing and Full-
color processing.
In pseudo-color processing, (false) colors are assigned to a monochrome image. For
example, objects with different intensity values may be assigned different colors, which
would enable easy identification/recognition by humans.
In full-color processing, images are acquired with full-color sensors/cameras. This has
become common in the last decade or so, due to the easy and cheap availability of color
sensors and hardware.
Color Fundamentals
When a beam of sunlight is passed through a glass prism, the emerging beam of light is not white
but consists of a continuous spectrum of colors. The color spectrum can be divided into six broad
regions: violet, blue, green, yellow, orange, and red.
Due to the absorption characteristics of the human eye, all colors perceived by the human can be
considered as a variable combination of the so-called three primary colors:
Red (R) (700 nm)
Green (G) (546.1 nm)
Blue (B) (435.8 nm)
Primary colors when added produce secondary colors:
Magenta (red + blue)
Cyan (green + blue)
Yellow (red + green)
Color Models
The purpose of a color model (or color space or color system) is to facilitate the
specification of color in some standard fashion.
A color model is a specification of a 3-D coordinate system and a subspace within that
system where each color is represented by a single point.
Most color models in use today are either based on hardware (color camera, printer) or
applications involving color manipulation (computer graphics, animation).
In image processing, the hardware-based color models mainly used are RGB, CMYK, and
HSI. The RGB (red, green, blue) color system is used mainly in color monitors and video
cameras.
The CMYK (cyan, magenta, yellow, black) color system is used in printing devices.
The HSI (hue, saturation, intensity) is based on the way humans describe and interpret
color. It also helps in separating the color and grayscale information in an image.
RGB Color
Each color appears in its primary spectral components of red (R), green (G), and blue (B).
Mainly used for hardware such as color monitors and color video cameras.
The primary colors red, green, and blue correspond to three corners of the cube, whereas
the secondary colors cyan, magenta, and yellow correspond to three other corners. Origin
(0,0,0) represents black and (1,1,1) represents white.
Images in the RGB model consist of three independent component images, one for each
primary color
When fed into an RGB monitor, these three images combine on the phosphor screen to
produce a composite color image.
The number of bits used to represent each pixel in RGB space is called pixel depth.
For example, if eight bits are used to represent each of the primary components, each RGB
color pixel would have a depth of 24 bits. This is usually referred to as a full-color image.
There are 2 =16,777,216 unique colors possible in this system.
RGB-24-bit color cube
HSI Model
HSI stands for hue, saturation, and intensity. This model is interesting because it can initially seem
less intuitive than the RGB model, although it describes color in a way that is much more consistent
with human visual perception.
The RGB model indeed draws upon our familiarity with mixing primary colors to create other
colors, but in terms of actual perception, RGB is very unnatural. People don’t look at a grapefruit
and think about the proportions of red, green, and blue that are hidden inside the somewhat dull,
yellowish-orangish color of the rind or the shinier, reddish flesh. Though you probably never
realized it, you think about color more in terms of hue, saturation, and intensity.
CMYK Color Model
CMYK stands for Cyan, Magenta, Yellow, and Key (Black), and it is a subtractive color model
used in printing. In this model, colors are created by subtracting different amounts of cyan,
magenta, yellow, and black ink from a white background. Unlike the RGB model, which is an
additive model, the CMYK model is a subtractive model, which means that it starts with a white
background and subtracts colors from it to create the desired hue. The CMYK color model is used
in printing technologies such as offset printing, flexography, and digital printing.
Gray Level to Color Transformations
This transformation is more general and thus is capable of achieving a wider range of pseudo-color
enhancement results than the simple slicing technique discussed in the preceding section. A
particularly attractive approach. The idea underlying this approach is to perform three results that
are then fed separately into the red, green, and blue channels of a color content modulated by the
nature of the transformation function. Note that these are transformations on the gray-level values
of the image and are not functions of position. The method discussed in the previous section is a
special case of the technique just described. There, piecewise linear function of the gray levels is
used to generate colors. The method discussed in this section, on the other hand, can be based on
a smooth, nonlinear function, which as might be expected gives the technique considerable
flexibility.