Chapter 3 Images and Graphics
Chapter 3 Images and Graphics
Graphics
• Digital Image Representation
• Image and graphics Format
• Image Synthesis , analysis and Transmission
Nature of Digital Images
• Image is the spatial representation of an object. It may be 2D or 3D
scene or another image.
• Images may be real or virtual. It can be abstractly thought of as
continuous function defining usually a rectangular region of plane.
• Example:
▪ Recorded image- photographic, or in digital format
▪ Computer vision- video image, digital image or picture
▪ Computer graphics- digital image
▪ Multimedia- deals about all above formats
Digital Image Representation
• A digital image is represented by a matrix of numeric values each representing a
quantized intensity value.
• When I is a two-dimensional matrix, then I(r, c) is the intensity value at the position
corresponding to row r and column c of the matrix.
• The points at which an image is sampled are known as picture elements, commonly
abbreviated as pixels. The pixel values of intensity images are called gray scale levels.
• Image resolution: The number of pixels in a digital image ( higher resolution → better
quality).
• The intensity at each pixel is represented by an integer and is determined from the
continuous image by averaging over a small neighborhood around the pixel location.
• If there are just two intensity values, for example, black, and white, they are represented
by the numbers 0 and 1; such images are called binary-valued images.
• If 8-bit integers are used to store each pixel value, the gray levels range from 0 (black) to
255 (white).
Digital Image Representation
• Intensity value can be represented by:
▪ 1-bit: black & white images
▪ 8-bits: grayscale images .
▪ 8-bit color images
▪ 24-bits: color images (RGB)
1 Bit Images
• Monochrome Image:
• Each pixel is stored as a single bit (0 or 1),
• A 640 x 480 monochrome image requires 37.5 KB of storage.
• Image dimensions: 640 x 480 pixels
• Total number of pixels: 640 * 480 = 307,200 pixels
• Total number of bytes needed: 307,200 bits / 8 = 38,400 bytes
• Total number of kilobytes: 38,400 bytes / 1024 = 37.5 KB
8-BIT GRAY-LEVEL IMAGES
• Many systems can make use of 8 bits of color information (the so-
called “256 colors”) in producing a screen image.
• With 8 bits per pixel and color lookup table we can display at most
256 distinct colors at a time
• Basically, the image stores not color, but instead just a set of bytes,
each of which is actually an index into a table with 3- byte values that
specify the color for a pixel with that lookup table index.
• Suitable for colorful photos, graphics, digital art etc.
24 Bit Color Images
• Example: Let's consider two images of a cat, one with a low resolution and the
other with a high resolution:
• Low Resolution:
▪ Image Size: 800x600 pixels
▪ This image appears blurry and pixelated when enlarged.
▪ Details like fur texture and facial features might not be well-defined.
• High Resolution:
▪ Image Size: 4000x3000 pixels
▪ This image looks sharp and clear even when enlarged.
▪ You can see fine details like individual strands of fur and intricate facial expressions.
• In this example, the high-resolution image has a greater pixel density, which
results in a better-defined and more detailed representation of the cat compared
to the low-resolution image.
Vector Graphics
• Vector graphics are a type of computer graphics that use
mathematical objects such as points, lines, curves, and shapes to
represent images.
• They are resolution-independent, which means that they can be
scaled to any size without losing quality.
• They are smaller in file size than raster graphics, making them ideal
for web use.
• This scalability makes vector graphics ideal for various applications,
including logos, illustrations, typography, and animations.
Vector VS Bitmap
• Class Assignment
Image and Graphics file format
• A digital image is stored in a file conforming to certain format. In addition
to pixel data, the file contains information to identify and decode data:
▪ Format
▪ Image size
▪ Depth
▪ Color and palette
▪ Compression
• Some formats are defined to work only in certain platform while other can
be used for all platforms. Some formats are specific for an application.
Some formats are for images, others are for vector graphics. Some format
allows compression, other allows only raw data.
• Formats using compression will make file size smaller. Some compression
algorithms will lose some image information.
Image file format
Format Extension
JPEG (Joint Photographic Expert Group) .jpg, .jpeg
PNG (Portable Network Graphics) .png
GIF (Graphics Interchange Format) .gif
BMP (Bitmap) .bmp
TIFF (Tagged Image File Format) .tiff, .tif
SVG (Scalable Vector Graphics) .svg
EPS (Encapsulated PostScript) .e[s
AI (Adobe Illustrator) .ai
PSD (Adobe Photoshop) .psd
WebP .webp
HEIF (High Efficiency Image Format) .heif, .heic
Color Systems
• Color is what we see when light interacts with things around us.
• It is the way we perceive the different wavelengths of light.
• The human eye can see about 1 million different colors, which are
created by mixing different wavelengths of light.
• For example, when white light hits an object, some of the
wavelengths are absorbed by the object and some are reflected. The
reflected wavelengths are what we see as the object's color. So, a red
apple reflects red light and absorbs all other wavelengths.
Colour System
• Colour is a vital component of multimedia. Colour management is
both subjective and technical exercise, because:
▪ Colour is a physical property of light but
▪ Colour perception is a human physiological activity
▪ Choosing a right colour or colour combination involves many trials and
aesthetic judgement
▪ Colour is a physical property of light, and it is determined by the wavelength
of the light wave. The human eye can see light waves in the range of 380 to
760 nanometers, which is why we can see the colors that we do.
RGB Colour Model
• RGB stands for Red, Green, Blue.
• It is probably the most popular colour model used in computer
graphics.
• It is an additive system in which varying amount of three colours red,
green and blue are added to produce new colours.
• All other colors can be created by mixing these three primary colors in
different ways.
• The amount of each primary color is represented by a value between
0 and 255, where 0 is the absence of the color and 255 is the full
intensity of the color.
RGB Colour Model
• For example, the color red is represented by the value (255, 0, 0),
which means that the red component is at full intensity and the green
and blue components are at zero intensity.
• The RGB color model is used in many digital devices, such as
computer monitors, televisions, and cameras.
RGB Colour Model
• RGB color model can be used to create different colors:
▪ Mixture of red and green light creates yellow light.
▪ Mixture of red and blue light creates magenta light.
▪ Mixture of green and blue light creates cyan light.
▪ Mixture of all three primary colors (red, green, and blue) creates white light.
▪ No light at all creates black.
CMY Color Model
• The three primary colors in the CMY model are cyan, magenta, and yellow.
• Cyan, Magenta and Yellow should absorb all the light thus resulting in
black.
• It is a subtractive color model, which means that colors are created by
subtracting different wavelengths of light.
• The amount of each primary color is represented by a value between 0 and
1, where 0 is the absence of the color and 1 is the full intensity of the color.
• For example, the color red is represented by the value (0, 1, 1), which
means that the cyan and magenta components are at zero intensity and
the yellow component is at full intensity.
• It is used in printing, where it is used to create inks that can be used to
reproduce colors on paper.
CMY Color Model
• How the CMYK color model can be used to create different colors:
▪ Mixture of cyan and yellow light creates green light.
▪ Mixture of magenta and yellow light creates red light.
▪ Mixture of cyan, magenta, and yellow light creates black.
▪ Adding black to any of the colors will make the color darker.
• The CMYK color model is not as widely used in digital devices as the
RGB color model, because it is not as accurate.
HSB Colour Model
• This is an image with only black and white pixels in it. Its pixels are arranged in an
order to form another image that is shown below. Note at the arrangement of
pixels has been changed, but not the quantity of pixels.
Object Detection
Face Detection
Image Recognition
Image Recognition
• A recognition methodology must pay substantial attention to each of
the following six steps: image formatting, conditioning, labelling,
grouping, extracting and matching.
Image Formatting
• Image formatting means capturing an image from a camera and
bringing it into a digital form.
• Digital representation of an image in the form of pixels.
Conditioning
• In an image, there are features which are uninteresting, either
because they were introduced into the image during the digitization
process as noise, or because they form part of a background.
• An observed image is composed of informative patterns modified by
uninteresting random variations.
• It suppresses the uninteresting variations in the image, effectively
highlighting the informative patterns.
• It can be applied uniformly to all images, regardless of their content.
Labeling
• Informative patterns in an image have structure. They are composed
of adjacent pixels that share some property, such as the same
intensity or color.
• Patterns can be identified by looking for continuous adjacent pixels
that differ greatly in intensity or color. These pixels are likely to mark
boundaries, between objects, or an object and the background.
• Edge detection techniques focus on identifying these continuous
adjacent pixels. There are many different edge detection techniques
(Canny, Laplacian), but they all work by finding the points in an image
where the intensity or color changes abruptly.
Labeling