Chapter 2 - Graphic Images

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 30

MULTIMEDIA

TECHNOLOGY

GRAPHICS AND

Dr. Zeeshan Bhatti


BSIT-III
Chapter 2
BY: DR. ZEESHAN BHATTI

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
BY: DR. ZEESHAN BHATTI

BITMAP AND VECTOR


IMAGES
Internal model of the image
Could be an array of pixels or
A mathematical description of lines, curves and shapes

Still images are generated in two ways: bitmaps (or


raster-based) or vector-drawn

BY: DR. ZEESHAN BHATTI

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

BY: DR. ZEESHAN BHATTI

BITMAP IMAGES

BY: DR. ZEESHAN BHATTI

Whats the tradeof? more bits provide more color


depth, hence more photo-realism,
but require more memory and processing power
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: DR. ZEESHAN BHATTI

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, bzier curves
Easy to manipulate
Scale, skew, rotate
BY: DR. ZEESHAN BHATTI

VECTOR IMAGES

BY: DR. ZEESHAN BHATTI

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

Figure: A Vector image Showing


Bezier Curve BY: DR. ZEESHAN BHATTI 9

WHY MIGHT A VECTORDRAWN


REPRESENTATION USE
The first popular
vector-drawn images
were forA
LESS
MEMORY
THAN
computer-aided design (CAD)
BITMAP?
such as AutoCAD, for aiding engineers and artists in
creating complex renderings

Graphic artists designing for print media use vectordrawn 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
Macromedia Flash puts vector-drawing on the Web with a plug-in

BY: DR. ZEESHAN BHATTI

10

RASTERIZING
Converting between bitmaps and vectordrawn images:
Bitmap image editors convert vector-based
drawings to bitmaps by rasterizing
(Photoshop does this automatically)

BY: DR. ZEESHAN BHATTI

11

GRAPHIC/IMAGE DATA
This section introduces some of the most common graphics
and image file formats. Some of them are restricted to
particular hardware/operating system platforms, others are
cross-platform independent formats.
While not all formats are cross-platform, there are
conversion applications that will recognize and translate
formats from other systems.

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.
BY: DR. ZEESHAN BHATTI

12

RESOLUTION
Two terms
DPI and PPI

Screen resolution
Fixed resolution (nearly)
PAL, NTSC, VGA, SVGA
72dpi, 96dpi

Print / Scan resolution


User definable
Size variable
Physical dimension = pixel dimension/device
resolution
BY: DR. ZEESHAN BHATTI

13

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.

BY: DR. ZEESHAN BHATTI

14

ASPECT RATIO
Aspect Ratio means the ratio of files Width to its
Height. For example
640 x 480
1024 x 768

or

800 x 600

or

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: DR. ZEESHAN BHATTI

15

GRAPHIC/IMAGE DATA
STRUCTURES
A digital image consists of many picture elements, termed
pixels. The number of pixels that compose a monitor image
determine the quality of the image (resolution). Higher
resolution always yields better quality. A bit-map
representation stores the graphic/image data in the same
manner that the computer monitor contents are stored in
video memory
1.Monochrome/ 1-Bit Images
2.8-bit Gray-scale Images
3.8-bit Colour Images
4.24-bit Colour Images
5.32-bit Colour Images
BY: DR. ZEESHAN BHATTI

16

IMAGE DATA TYPES


The most common data types for graphics and image
file formats are 24-bit color and 8-bit color.
Some formats are restricted to particular
hardware/operating system platforms, while others
are \cross-platform" formats.
Even if some formats are not cross-platform, there are
conversion applications that will recognize and
translate formats from one system to another.
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.
BY: DR. ZEESHAN BHATTI

17

MONOCHROME/ 1-BIT
IMAGES
An example of 1-bit monochrome image is illustrated in
Fig. 3.4 where:
Image consists of Pixels or Pel (Picture Element).
A 1-bit image consists of on and off bits only and thus
is the simplest type of image.
Each pixel is stored as a single bit (0 or 1), or we can
say that each pixel occupies exactly 1- Bit in memory.
Hence it is also referred to as a binary image.
Monochrome 1-bit images can be satisfactory for
pictures containg onlysimple graphics and text.
BY: DR. ZEESHAN BHATTI

18

BY: DR. ZEESHAN BHATTI

19

8-BIT GRAY-SCALE
IMAGES
An
example gray-scale image is illustrated in Fig. 3.5
where:

Each pixel is usually stored as a byte, occupying 8-bits in


memory.
Each pixel has a grayscale value between 0 to 255,
where 0 is for Black and 255 is used for White colors, as
shown in figure 3.5a.
The Entire image can be thought of as a two-dimensional
array of pixel values. We refer to such an array as a
bitmap.
A 640 x 480 greyscale image requires over 300 KB of
storage, as shown in figure 3.5.

BY: DR. ZEESHAN BHATTI

20

A Gray scale color representat

Example of a Gray-scale Bit-map Image

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)
Bitplanes for 8-bit gray scale image

BY: DR. ZEESHAN BHATTI

21

8-BIT COLOUR IMAGES


An example 8-bit colour image is illustrated in Fig.3.6
where:
One byte for each pixel
Supports 256 out of the millions s possible,
acceptable colour quality
Requires Colour Look-Up Tables (LUTs)
A 640 x 480 8-bit colour image requires 307.2 KB of
storage (the same as 8-bit greyscale)

BY: DR. ZEESHAN BHATTI

22

COLOR LOOKUP
TABLE(LUTS OR CLUTS)

The idea used in 8-bit color images is to store the


index, or code value, for each pixel. Then, if a
pixel stores, say, the value 25, the meaning is to
go to row 25 in a color lookup table (LUT).

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.
The LUT is often called palette

ZEESHAN BHATTI
23
ExampleBY:
ofDR.
8-Bit
Colour Image

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.

BY: DR. ZEESHAN BHATTI

24

COLOR-PICKER
A Color-picker consists of an array of fairly large
blocks of color (or a semi-continuous range of
colors) such that a mouse-click will select the color
indicated.
In reality, a color-picker displays the palette colors
associated with index values from 0 to 255.
Fig. 3.9 displays the concept of a color-picker: if the user
selects the color block with index value 2, then the color
meant is cyan, with RGB values (0; 255; 255).

A very simple animation process is possible via


simply changing the color table: this is called color
cycling or palette animation.
BY: DR. ZEESHAN BHATTI

25

BY: DR. ZEESHAN BHATTI

26

24-BIT COLOUR IMAGES


An example 24-bit colour image is illustrated in Fig. 6.14 where:

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

BY: DR. ZEESHAN BHATTI

27

Fig. 3.5 shows the image forestre.bmp., a 24-bit


image in Microsoft Windows BMP format. Also shown
are the grayscale images for just the Red, Green, and
Blue channels, for this image.

BY: DR. ZEESHAN BHATTI

28

32-BIT COLOUR IMAGES


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: DR. ZEESHAN BHATTI

29

THANKYOU

Q&A
For My Slides and Handouts

http://zeeshanacademy.blogspot.com/
https://www.facebook.com/drzeeshanacademy

BY: DR. ZEESHAN BHATTI

30

You might also like