0% found this document useful (0 votes)
53 views48 pages

MC 5

This document provides information about images and image concepts. It discusses how images are captured from the real world as two-dimensional representations. Images can represent photographs, paintings, drawings and more. Key concepts discussed include how images are represented digitally using pixels and different color depths. File sizes are determined by the image resolution, number of bits per pixel, and compression used. Common file formats like BMP, JPEG and GIF are also summarized.

Uploaded by

Muskan Khann
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)
53 views48 pages

MC 5

This document provides information about images and image concepts. It discusses how images are captured from the real world as two-dimensional representations. Images can represent photographs, paintings, drawings and more. Key concepts discussed include how images are represented digitally using pixels and different color depths. File sizes are determined by the image resolution, number of bits per pixel, and compression used. Common file formats like BMP, JPEG and GIF are also summarized.

Uploaded by

Muskan Khann
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/ 48

Multimedia Communication (SW-416)

IMAGES

Dr. Areej Fatemah email: [email protected]


Capturing Real-World Images
Picture: two dimensional image captured from a real-world scene that represents a
momentary event from the 3D spatial world
What can Images represent?

Photographs
Paintings
Drawings
Symbols
Corporate logos
Flags
Maps
Diagrams
Graphs
Image Concepts
• An image is a function of intensity values over a 2D plane I(r,s)
• Sample function at discrete intervals to represent an image in
digital form
◦ matrix of intensity values for each color plane
◦ intensity typically represented with 8 bits
• Sample points are called pixels
• Quantization refers to the number of bits per pixel
Image Concepts
• Pixels
Image Presentation
• Bitmap
◦ The two-dimensional array of pixel values that represents the
graphics/image data

• Image resolution
◦ The number of pixels in a digital image (width x height)
Image Concepts
• Pixels
Image Concepts
• Image (1-bit Quantization)

1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
1 1 0 0
1 1 1 1
1 1 1 1
Image Presentation
• Frame buffer:
◦ Hardware used to store bitmap.
• A graphics card is used for this purpose.
◦ but if not enough video card memory is available then the data has to be
shifted around in RAM for display.

• File size = ?
◦ width x height x #ofBitsPerPixel
Image Concepts
Monochrome Images
• Each pixel is stored as a single bit (0 or 1)
◦ Also referred to as binary image.
◦ Such an image is also called a 1-bit monochrome
image since it contains no color.
◦ For pictures containing simple graphics / text
• p(x,y) = 0 or 1
• A 640 x 480 monochrome image requires 37.5
Kbytes
640 x 480 x 1 = 307200 bits
307200 / 8 = 38400 bytes
38400 / 1024 = 37.5 Kbytes
Image Concepts
• Image (3-bit Quantization)
Image Concepts
3-Bit Images
• Each pixel is stored with 3 bit color information
◦ p(x,y) = 000, 001, …., 111

• A 640 x 480 3-bit image requires 112.5 Kbytes

640 x 480 x 3 = 921600 bits


921600 / 8 = 115200 bytes
38400 / 1024 = 112.5 Kbytes
Image Concepts
Gray-scale Images
(single color plane with 8 bits (00000000 – 11111111))
• Each pixel is usually stored as a byte (0 to 255)
• A 640 x 480 gray-scale image requires:
• 300 KBytes

640 x 480 x 8 = 2,457,600 bits


2,457,600 / 8 = 307200 bytes
307200 / 1024 = 300 Kbytes
(00000000 – 11111111) + (00000000 – 11111111) + (00000000 – 11111111)
Image Concepts 8 bits for red, 8 bits for Green, 8 bits for Blue (24bit images)

• Pixels
Image Concepts
Color Images
three color planes each with 8 bits (RGB, CMY, YIQ, etc.)
• Each pixel is usually stored with 8, 16, or 24
bit color information.
◦ Information for each color R, G, and B
Color Images
• What would be the file size of a 4 bit image with a resolution of 1024x768?
File size calculation
◦ File size= 1024 x 768 x 4/8
◦ File size = 393,216 bytes = 384 Kbytes

• What would be the file size of a 24 bit image with a resolution of


1280x1024?
File size calculation
◦ File size = 1280 x 1024 x 3
◦ File size = 3,932,160 bytes = 3840 Kbytes
Image Representation
Image Representation
• Bitmap techniques
◦ Pixel: the smallest discrete component of an
image on the screen
◦ Pixel-by-pixel representation of the color : short
for “picture element”
◦ Wide range of colors and shades in complex
images
• Vector techniques
◦ Comprises of mathematical representations
◦ Scalable
◦ Small file size
Image Representation
• A vector is a line that is described by the locations
of its two end points.
• Vector drawings make use of Cartesian coordinates.
• Vector drawings provide x, y and z axis and different
perspective views.
• Vector graphic files store the lines, shapes and
colors that make up an image as mathematical
formulae.
• A vector graphics program uses these mathematical
formulae to construct the screen image, building
the best quality image possible, given the screen
resolution.
Image Representation
• The mathematical formulae determine where the dots that make up the
image should be placed for the best results when displaying the image.
• Since these formulae can produce an image scalable to any size and detail,
the quality of the image is limited only by the resolution of the display, and
the file size of vector data generating the image stays the same.
• Vector images use less memory space and have smaller file sizes as
compared to Bitmaps.
• For The Web:
• Pages that use vector graphics in plug-ins download faster.
• When used for animation, draw faster than bitmaps.
Converting Images
• Converting from a vector to a bitmap is generally easier than the opposite.
• To convert from bitmap to vector, you need something like tracing. It is
almost like; drawing over the bitmap to get a vector.
• Some software exist to help you accomplish this task like Adobe Illustrator
CS2, Corel Trace but you will have to do some work to get better results.
◦ It will never be a matter of opening the jpg image and simply saving it as an
Illustrator ai file.
Image Scalability
• Because the vector image is comprised of mathematically defined objects,
rather than by a pre-ordered pattern of pixels, its size can be easily
manipulated with little to no loss in the quality of the image.
◦ The objects within the image are simply re-rendered at a greater or smaller scale,
providing consistently smooth edges at any size.
• Bitmaps, on the other hand, are more difficult to scale, because changing the
size of a bitmap requires a complete rearrangement of the pixels.
• Many graphics programs do an excellent job of reducing bitmaps, but
enlargements always result in a loss of quality.
Image Shape
• The vector image is versatile. It can be of any shape: from simple geometric
forms to many of the most complicated and most abstract forms imaginable.
This eliminates the problem of having a rectangular background around a non-
rectangular image.
• A bitmap always has four straight edges. It cannot be elliptical, triangular or
any other shape other than a rectangle.
• Certain efforts have been made to rectify this problem, such as the
transparency option available to GIF bitmaps, but for the most part, the
rectangular nature of the image remains a disadvantage to bitmaps.
Image Size
• Unfortunately, it is impossible to say that either vector or bitmap images are
smaller than other, as their size is dependent on variable factors.
• For Bitmap images, the most important determinant for file size is the
proportions of the image itself. The larger the image, the more pixels it
contains, thus, the larger the file size.
• Size is also affected by format.
◦ Different formats have different properties, and save information in different ways.
For example, the GIF image type only allows for 256 colors to be displayed within
an image, helping to reduce the overall size of the file.
◦ JPEGs, on the other hand, use all 16 million available colors, but use compression
algorithms (which are different from vector algorithms) to reduce the overall size
of the file.
Image Size
• The size of vector graphics files is not dependent on the size of the image, but
on its complexity.
• The more objects there are in a vector, the more algorithms it will need to
contain in order to render those objects, and the larger the file will become.
• This means that a large image comprised of a few objects will have a smaller
file size than a small image comprised of numerous objects.
Digitization
• An image is broken into thousands of pixels.
• An image stored in this way is called a bitmap.
• In color images Pixels are represented by three numbers:
◦ Red 0-255
◦ Blue 0-255
◦ Green 0-255
Color Depth
1 bit ( 2 colors) 2 bit ( 4 colors)

4 bit ( 16 colors) 8 bit ( 256 colors)


8-bit v/s 24-bit Images
Color Images
• The most common data types for graphics and image file formats is 24-bit
color and 8-bit color.
• Most image formats incorporate some variation of a compression
technique due to the large storage size of image files.
• Compression techniques can be classified into either lossless or lossy.
Color Images
24-bit Images
• In a color 24-bit image, each pixel is represented by three bytes, usually
representing RGB.
• This format supports 256x256x256 possible combined colors, or a total of
16,777,216 possible colors.
• Storage penalty: 24-bit color image would require 921.6 kB of storage
without any compression (640x480).
• An important point: many 24-bit color images are actually stored as 32-bit
images, with the extra byte of data for each pixel used to store an alpha
value representing special effect information (e.g., transparency).
Image File Formats
• A digital image is stored in a file conforming to certain format. In addition to
the pixel data, the file contains information to identify and decode the data
such as format, image size, depth, color/palette and compression.
• Digital images can be created by a variety of input devices and techniques,
such as digital cameras, scanners, coordinate-measuring machines,
airborne radar, and more.

• BMP device – independent files frequently used in windows. It is based on


RGB color model. Valid color depth values are 1, 4, 8 and 24. Uses RLE to
compress images.
Image File Formats
• JPEG – Joint Photographic Experts Group is of type bitmap, it uses lossy
compression hence file size is very small and popular over the web.
• Strengths:
◦ Provides support for 24 bit color image.
◦ Suited to image of real-world scenes or complex computer generated images.
◦ It is platform independent.
• Weakness:
◦ Lossy compression
◦ Bad quality is obtained when compressing with sharp edges.
◦ Degree of compression is greater for full color images than it is for gray scale
images.
Header and Color
Table Information
Image File Formats
• GIF – Graphic Interchange Format is
of type bitmap. Image 1
• It is cross platform, indexed color,
allows animation.
• Popular on web and uses lossless Image 2
LZW compression (20-25%
compression with no loss in quality).

Image n
Image File Formats
GIF – Graphic Interchange Format
• The Header is 6bytes in size and is used only to identify the file as type GIF. The Logical Screen
Descriptor, which may be separate from the actual file header, may be thought of as a second header.
You may store the Logical Screen Descriptor information in the same structure as the Header:
• typedef struct _GifHeader
• {
• // Header
• BYTE Signature[3]; /* Header Signature (always "GIF") */
• BYTE Version[3]; /* GIF format version("87a" or "89a") */
• // Logical Screen Descriptor
• WORD ScreenWidth; /* Width of Display Screen in Pixels */
• WORD ScreenHeight; /* Height of Display Screen in Pixels */
• BYTE Packed; /* Screen and Color Map Information */
• BYTE BackgroundColor; /* Background Color Index */
• BYTE AspectRatio; /* Pixel Aspect Ratio */
• }
• GIFHEAD;
Image File Formats
• GIF – Graphic Interchange Format
• Strength:
◦ It is lossless for 8-bit images.
◦ best suited for images with few distinctive colors (e.g., graphics or drawing)
◦ Well suited for image sequences (can have multiple images in a file)
◦ Animated GIFs are easy to make by using GIF construction packages.

• Weakness:
◦ Not suitable for 24-bit images.
◦ When compressing such images, much of color information is lost.
◦ Compression ratios are low.
Image File Formats
• PNG – Portable Network Graphics is of type bitmap, it is platform
independent and compression is ZIP method.

• TIFF – Tagged Image File Format is of type bitmap, it allows various types of
compressions, and different depths, popular in many industrial
applications.
◦ It offers, binary levels, gray levels, palettes, RGB and CMKY colors.
◦ Support of broad range of compression methods including run-length
encoding, LZW compression and various encoding methods including Huffman
encoding.
Image File Formats
• Postscript is an important language for typesetting, and many high-end
printers have a Postscript interpreter built into them.
• Postscript is a vector-based picture language, rather than pixel-based: page
element definitions are essentially in terms of vectors.
◦ Postscript includes text as well as vector/structured graphics.
◦ Several popular graphics programs, such as Illustrator and FreeHand, use
PostScript.
◦ Postscript language itself does not provide compression; (stored as ASCII).
• Another text + figures language.
◦ Adobe Systems Inc. includes LZW compression in its Portable Document
Format (PDF) file format.
Image File Formats
• PostScript – It is of type vector and is a page description language. Used to
describe images in a device independent manner.
• Level 1 PostScript-Concept of scalable fonts
• Level 2 PostScript- Filling of patterns and regions. Efficient text processing
and complete color concept for both device dependent and device
independent resolution.
• Level 3 Postscript- Modern digital document processing
• AutoCAD DXF – It is of type vector and is specific for CAD applications.
Image Dithering
• Dithering is used in computer graphics to create the illusion of color depth in
images on systems with a limited color palette.
◦ It is an attempt by a computer program to approximate a color from a mixture of
other colors when the required color is not available.
◦ In a dithered image, colors that are not available in the palette are approximated by a
diffusion of colored pixels from within the available palette.
• For example, dithering occurs when a color is specified for a Web page that a
browser on a particular operating system can't support.
• Dithering also occurs when a display monitor attempts to display images specified
with more colors than the monitor is equipped to handle.
Image Dithering
Example
• Dithering is a retro way of reducing the colors in
an image for use on old hardware or in print. It
removes colors, and strategically place dots to
emulate the missing shades.

• How would you display this image on a black and white


screen?
• The simplest way is to go through each pixel and if it's a
light-ish pixel turn it on, if it's a darkish pixel turn it off.
• So, we pick a threshold, some shade between black and
white, and if a pixel is lighter than the threshold we turn
it on. If it's darker we turn it off.
Image Dithering
Example
• With just two shades we've lost too much
of what makes the pic recognizable e.g.
the contours of the face.
• This is where dithering comes in.
• Dithering simulates all the missing shades
with a diffusion of dots.
• It swaps pixel brightness with dot density.
The denser the dots, the darker the shade.
• The next image uses only on and off pixels
like the one above, but this time we've
dithered it:
Image Dithering
Image Morphing
• Morphing is an image processing technique used for the metamorphosis from one
image to another.
• The idea is to get a sequence of intermediate images which when put together with
the original images would represent the change from one image to the other.
• The simplest method of transforming one image into another is to cross-dissolve
between them.
• In this method, the color of each pixel is interpolated over time from the first image
value to the corresponding second image value.
◦ This is not so effective in suggesting the actual metamorphosis. For morphs between faces,
the metamorphosis does not look good if the two faces do not have the same shape
approximately.
Image Morphing

Person-1 Morphing Person-2


Image Morphing
Image Morphing

You might also like