(Lecture Handout) (Chapter 3) (Graphics & Image Data) (Http://iict - Usindh.edu - Pk/zeeshan)
(Lecture Handout) (Chapter 3) (Graphics & Image Data) (Http://iict - Usindh.edu - Pk/zeeshan)
(Lecture Handout) (Chapter 3) (Graphics & Image Data) (Http://iict - Usindh.edu - Pk/zeeshan)
Semester]
[BS(IT) part III & part IV, Second
By: Zeeshan Bhatti
]
[Lecture Handout] [Institute of Information and Communication Technology,
[Chapter 3] University of Sindh, Jamshoro]
[Graphics & Image Data]
[http://iict.usindh.edu.pk/zeeshan]
Chapter 3: Graphics & Image Data
Multimedia Technology
Chapter 3
Graphics and Image Data
3.1 Graphical Images
Graphical images obviously play a very important role in multimedia pieces
• Images may be photograph‐like bitmaps, vector‐based drawings, or 3D renderings
• Tools for image management focus on different kinds of images and converting between
formats peculiar to different tools and platforms
3.2 Bitmap and Vector Images
Still images are generated in two ways: bitmaps (or raster‐based) or vector‐drawn
3.2.1 Bitmap Images
A bitmap is a matrix describing the individual dots that are the smallest elements (pixels) of
resolution on a computer screen or printer or we can say a bitmap image is an array of logical
pixels.
• monochrome just requires one bit per pixel, representing black or white
• 8 bits per pixel allows 256 distinct colors, 16 bits per pixel represents 32K distinct colors, 24 bits
per pixel allows millions of colors
• What’s the tradeoff? more bits provide more color depth, hence more photo‐realism,
o but require more memory and processing power
o Settling for just 256 colors forces someone to decide, which colors?
• Graphics production software may capture in 24‐bit color and convert to 8‐bit
• GIF and PNG formats use a 8‐bit color table allowing up to 256 colors
• JPG preserves more color depth with 16 bits per pixel
• Photoshop file (PSD) preserve 24 bits or more per pixel
By: Zeeshan Bhatti Page 2
Chapter 3: Graphics & Image Data
•
Figure 3.1: A Bitmap Image Figure 3.2: A Vector Image
3.2.2 Vector Images
A vector-drawn image is created from geometric objects such as lines, rectangles, ovals, polygons
using mathematical formulas
Mathematical description of lines, curves and shapes
Requires computation to determine logical pixels
Compact, scalable, resolution independent and easy to edit
Based on co-ordinates and algorithms
Description is infinitely thin
Computation chooses logical pixels
Anti-aliasing to fix jaggies
Basic blocks
Squares, polygons, ellipses, lines, bézier curves…
Easy to manipulate
Scale, skew, rotate…
• e.g., RECT 0,0,300,200,RED,BLUE says (using Cartesian coordinates)
“Draw a rectangle starting at 0,0 (upper left corner of screen)
going 300 pixels horizontally right and 200 pixels downward,
with a RED boundary and filled with BLUE.”
By: Zeeshan Bhatti Page 3
Chapter 3: Graphics & Image Data
• Why might a vector‐drawn representation use less memory than a bitmap?
• The first popular vector‐drawn images were for computer‐aided design (CAD)
such as AutoCAD, for aiding engineers and artists in creating complex renderings
• Graphic artists designing for print media use vector‐drawn objects because they put rectangles
and Bezier curves on paper without jaggies, exploiting high resolution printers
• Macromedia Freehand, Corel Draw & Adobe Illustrator are vector‐drawing applications
o Macromedia Flash puts vector‐drawing on the Web with a plug‐in
3.2.3 Converting between bitmaps and vector‐drawn images:
• Bitmap image editors convert vector‐based drawings to bitmaps by rasterizing
(Photoshop does this automatically)
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. We will study various video and audio compression techniques in the Next Chapters.
Image Resolution:
Image resolution refers to the number of pixels per inch area of an image.
• Higher the resolution, means higher the number of pixels in that image hence better
the quality but also with increase in file size.
• Lower the resolution means less amount of pixels in an image and hence having poor
quality with less file size.
Aspect Ratio:
Aspect Ratio means the ratio of file’s Width to its Height. For example
640 x 480 or 800 x 600 or 1024 x 768
• These number define the Width and height of an image but with a specific aspect ratio
of 4:3
• all Monitors and Display systems fallow a particular aspect ratio i.e. 4:3, to display
contents.
• This 4:3 aspect ratio has been found to look natural on Monitors and other display
systems.
By: Zeeshan Bhatti Page 4
Chapter 3: Graphics & Image Data
By: Zeeshan Bhatti Page 5
Chapter 3: Graphics & Image Data
We can think of the 8-bit images as a set of 1-bit bitplanes, where each plane consistes of a
1-bit representation of the image at higher and higher level of “elevation”: a bit is turned on if
the image pixel has a nonzero value at or above that bit level.
Figure 3.6b displays the concept of bitplanes graphically. Each bit-plane can have a
value of 0 or 1 at each pixel but together, all the bitplanes make up a single byte that stores
values between 0 and 255 (in this 8-bit situation)
For an 8-bit image, the image file can store in the file header information just what 8 bit values
for R, G, and B correspond to each index. Figure 3.8 displays this idea.
By: Zeeshan Bhatti Page 6
Chapter 3: Graphics & Image Data
• Each pixel is represented by 24-bit (three bytes).Each byte is for separate color channel i.e.
RGB.
•1 byte for Red has 255 shades of Red to White and similarly for other Green and Blue color.
• Supports 256 x 256 x 256 possible combined colours (16,777,216)
• A 640 x 480 24-bit colour image would require 921.6 KB of storage
• Most 24-bit images are 32-bit images, the extra byte of data for each pixel is used to store an
alpha value representing special effect information
By: Zeeshan Bhatti Page 7
Chapter 3: Graphics & Image Data
Chapter 3: Graphics & Image Data
Uses a colour map of 256 possible RGB values, contained in file. Only the 8 bit index is
transmitted for each pixel that contains the closest match color to th original one.
Compression ratio is close to 3:1. Color table is transferred to the receiver.
Provides support for animation - multiple pictures per file.
Provides one dimensional interlacing dividing the image into 4 groups: first contains 1/8
of the image, second –1/8, third – ¼, last – 1/2.
This is patented technology.
JPEG
• A standard for photographic image compression created by the Joint Photographics
Experts Group
• Takes advantage of limitations in the human vision system to achieve high rates of
compression.
•JPEG allows the user to set a desired level of quality, or compression ratio (input divided by
output).
• Lossy compression which allows user to set the desired level of quality/ compression
• Detailed discussions in next chapter on compression.
By: Zeeshan Bhatti Page 9
Chapter 3: Graphics & Image Data
PNG
Portable Network Graphics (PNG)
The PNG format is intended as a replacement for GIF in the WWW and in image editting.
GIF uses LZW compression, which is patented by Unisys. All uses of GIF may have to pay
royalties to Unisys - PNG contains no patented technology.
PNG uses unpatented zip technology for compression
Provides transparency using alpha value.
2 Dimensional interlacing.
PNG of a single toucan overlaid to create a single picture. Notice how the shadows are overlaid
on lower toucan.
PNG supports multiple image layers, and adds an alpha byte to the RGB bytes to describe how to
combine each pixel with pixels from other layers or other images, ranging from totally
transparent to totally opaque.
TIFF
• Tagged Image File Format (TIFF), stores many different types of images
(e.g., monochrome, greyscale, 8-bit & 24-bit RGB, etc.) –> tagged
• Developed by the Aldus Corp. in the 1980’s and later supported by the Microsoft
• TIFF is a lossless format (when not utilizing the new JPEG tag which allows for JPEG
compression).
• It does not provide any major advantages over JPEG and is not as user controllable
it appears to be declining in popularity
By: Zeeshan Bhatti Page 10
Chapter 3: Graphics & Image Data
Postscript/Encapsulated Postscript
• A typesetting language which includes text as well as vector/structured graphics and bit-
mapped images
• Used in several popular graphics programs (Illustrator, FreeHand)
• Does not provide compression, files are often large
X-windows: XBM
• Primary graphics format for the X Window system
• Supports 24-bit colour bitmap
• Many public domain graphic editors, e.g., xv
• Used in X Windows for storing icons, pixmaps, backdrops, etc.
EXIF
(Exchang Image File) is an image format for digital cameras:
1. Compressed EXIF _les use the baseline JPEG format.
2. A variety of tags (many more than in TIFF) are available to facilitate higher quality printing,
since information about the camera and picture-taking conditions (flash, exposure, light source,
white balance, type of scene, etc.) can be stored and used by printers for possible color cor-
rection algorithms.
3. The EXIF standard also includes speci_cation of _le format for audio that accompanies
digital images. As well, it also supports tags for information needed for conversion to FlashPix
(initially developed by Kodak).
By: Zeeshan Bhatti Page 11