ColorModels and Bits Representation

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

CSEN3231

Digital Image Processing


Color Model
 Color models provide a standard way to specify a particular
color, by defining a 3D coordinate system, and a subspace
that contains all colors within a particular model.
 Any color that can be specified using a model will
correspond to a single point within the subspace it defines.
 Each color model is oriented towards either specific
hardware (RGB, CMY, YIQ), or HSI or image processing
applications.
• Hardware oriented models:
 RGB (red, green, blue): Monitor video camera.
 CMY (cyan, magenta, yellow), CMYK (CMY, black)
model for color printing.
 HSI model, which corresponds closely with the way
humans describe and interpret color.
Color Model…
 Application oriented models
 These models are used in applications where color manipulation
is a goal.
 One example is the creation of color graphics for animation.
 The RGB Model
 In the RGB model, an image consists of three
independent image planes, one in each of the primary
colors: red, green and blue.
 The standard wavelengths for the three primaries are as
shown in figure. Specifying a particular color is by
specifying the amount of each of the primary
components present.
 Given figure shows the geometry of the RGB color
model for specifying colors using a Cartesian coordinate
system.
An RGB Color Model…
 The grayscale spectrum, i.e., those colors made from
equal amounts of each primary color, lies on the line
joining the black and white vertices.
Color Model…
 In above the RGB color cube, the gray scale spectrum
lies on the line joining the black and white vertices.
 This is an additive model, i.e., the colors present in the
light add to form new colors, and is appropriate for the
mixing of colored light.
 The image on the left of figure 6.2 shows the additive
mixing of red, green and blue primaries to form the three
secondary colors
 cyan (blue + green) and
 magenta (red + blue),
 yellow (red + green), and
 white (red + green + blue).
 The RGB model is used for color monitors and most
video cameras.
Color Model…
 The figure on the right shows the three subtractive
primaries, and their pair wise combinations to form red,
green and blue, and finally black by subtracting all three
primaries from white.
Color Model…
 Pixel Depth: The number of bits used to represent each
pixel in the RGB space is called the pixel depth.
 If the image is represented by 8 bits then the pixel depth
of each RGB color pixel = 3*number of
bits/plane=3*8=24.
 A full color image is a 24 bit RGB color image.
 Therefore total number of colors in a full color image =
8^8=256 x 256 x 256 = 16,777,216.
 Safe RGB Colors:
 Many applications use only a few hundred or fewer
colors.
 Therefore, most of the system in use today is limited to
256 colors.
Pixel Values
 The information within an image element depends on the
data type used to represent it.
 Pixel values are practically always binary words of length
k so that a pixel can represent any of 2^k different
values.
 The value k is called the bit depth (or just “depth”) of the
image.
 The exact bit-level layout of an individual pixel depends
on the kind of image; for example, binary, grayscale, or
RGB color.
Some common image types
 Grayscale images (intensity images):
 The image data in a grayscale image consist of a single
channel that represents the intensity, brightness, or
density of the image.
 In most cases, only positive values make sense, as the
numbers represent the intensity of light energy or density
of film and thus cannot be negative, so typically whole
integers in the range of [0 . . . 2^(k−1)] are used.
 For example, a typical grayscale image uses k = 8 bits (1
byte) per pixel and intensity values in the range of [0 . . .
255],
 Where the value 0 represents the minimum brightness
(black) and 255 the maximum brightness (white).
Some common image types
 Binary images:
 Binary images are a special type of intensity image where
pixels can only take on one of two values, black or white.
 These values are typically encoded using a single bit (0/1) per
pixel.
 Binary images are often used for representing line graphics,
archiving documents, encoding fax transmissions, and of
course in electronic printing.
Some common image types
 Color images:
 Most color images are based on the primary colors red,
green, and blue (RGB), typically making use of 8 bits for
each color component.
 In these color images, each pixel requires 3×8 = 24 bits
to encode all three components, and the range of each
individual color component is [0 . . . 255].
 Finally, while most color images contain three
components, images with four or more color components
are common in most prepress applications, typically
based on the subtractive CMYK (Cyan-Magenta-Yellow-
Black) color model
Color Model…
 Such systems can have a subset of colors which can be
reproduced without depending on the hardware
capabilities of the system.
 This subset of colors is called as set of RGB colors or
the set of all systems safe colors.
 In internet applications, these colors are called the safe
web colors or safe browser colors.
 Standard safe Colors:
 It is assumed that a minimum number of 256 colors can
be reproduced faithfully by any system.
 Among these, 40 colors are found to be processed
differently by different operating system.
 Therefore the remaining 216 colors are accepted to be
the standard safe colors.
Color Model…
 Applications: Color monitors, Color video cameras, cathode-ray
tube (CRT), liquid-crystal display (LCD), plasma display, or organic
light emitting diode (OLED) display such as a television, a
computer's monitor, or a large scale screen.
 Advantages:
 Image color generation
 Changing to other models such as CMY is straight forward
 It is suitable for hardware implementation
 It is based on the strong perception of human vision to red,
green and blue primaries.
 Disadvantages:
 It is not acceptable that a color image is formed by combining
three primary colours.
 This model is not suitable for describing colors in a way which is
practical for human interpretation.
Color Model…
The CMY Color Model
 The CMY (cyan-magenta-yellow) model is a subtractive
model appropriate to absorption of colors.
 Whereas the RGB model asks what is added to black to
get a particular color, the CMY model asks what is
subtracted from white.
 In this case, the primaries are cyan, magenta and yellow,
with red, green and blue as secondary colors.
 When a surface coated with cyan pigment is illuminated
by white light, no red light is reflected, and similarly for
magenta and green, and yellow and blue.
 The CMY model is used by printing devices and filters.
The CMY Color Model
 The relationship between the RGB and CMY models is given
by:

 Normalization is a preprocessing step that transforms the data


into a standard scale.
 For RGB images, normalization typically involves converting
the pixel intensity values from 0 to 255, to a scale of 0 to 1.
• RGB Max - The module processes each pixel by dividing the
pixel by its intensity value.
– R = R/(R+G+B)
– G = G/(R+G+B)
– B = B/(R+G+B)
The CMYK Color Model
 CMYK Model
The HSI Color Model
 As mentioned above, color may be specified by the three
quantities hue, saturation and intensity which is similar to the
way of human interpretation.
 Hue: It is a color attribute that describes a pure color. The Hue
component describes the color itself in the form of an angle
between [0,360] degrees.
 0 degree mean red, 120 means green, and 240 means blue.
60 degrees is yellow, and 300 degrees is magenta.
 Saturation: It is a measure of the degree to which a pure color
is diluted by white light. The Saturation component signals
how much the color is polluted with white color. The range of
the S component is [0,1].
 Intensity: It is a measurable and interpretable descriptor of
monochromatic images, which is also called the gray level.
The Intensity range is between [0,1] and 0 means black, 1
means white.
The HSI Color Model
 As below figure shows, hue is more meaningful when
saturation approaches 1 and less meaningful when saturation
approaches 0 or when intensity approaches 0 or 1.
 Intensity also limits the saturation values.
The HSI Color Model
The HSI Color Model
The HSI Color Model

You might also like