You are on page 1of 14

1.1.2.

Images
Students should be able to:
• show understanding of how data for a bitmapped image is encoded
• use the terminology associated with bitmaps: pixel, file header, image
resolution, screen
resolution
• perform calculations estimating the file size for bitmapped images of
different resolutions
• show understanding of how data for a vector graphic is represented
and encoded
• use the terminology associated with vector graphics:
drawing object, property and drawing list
• show understanding of how typical features found in bitmapped
and vector graphics software are used in practice
• justify where bitmapped graphics and/or vector graphics are
appropriate for a given task

Images can be stored in a computer system for the eventual purpose of
displaying the image on the screen or for presenting it on paper,
usually as a component of a document. Such an image can be created
by using an appropriate drawing package. Alternatively, when an
image already exists independently of the computer system, the
image can be captured by using photography or by scanning.
1.
Vector Graphics
Vector graphic is a graphic consisting of components defined by
geometric formulae and associated properties, such as line
colour and style. It is normal for an image that is created by a
drawing package or a computer-aided design (CAD) package to
consist of a number of geometric objects. The outcome is then
usually for the image to be stored as a vector graphic file.
We do not need to consider how an image of this
type would be created. We do need to consider how
the data is stored after the image has been created.
A vector graphic file contains a drawing list. The list
contains a command for each object included in
the image. Each command has a list of attributes
that define the properties of the object. The
properties include the basic geometric data such
as, for a circle, the position of the centre and its
radius. In addition properties such as the thickness
and style of a line, the colour of a line and the
colour that fills the shape, if that is appropriate, are
defined. An example of what could be created as a
vector graphic file is shown in Figure 1.06

The most important property of a vector graphic image is that the
dimensions of the objects are not defined explicitly but instead are
defined relative to an imaginary drawing canvas. In other words, the
image is scalable. Whenever the image is to be displayed the file is
read, the appropriate calculations are made and the objects are
drawn to a suitable scale. If the user then request s that the image is
redrawn at a larger scale the file is read again and another set of
calculations are made before the image is displayed. This process
cannot of itself cause distortion of the image.
2.
Bitmaps
Most images do not consist of geometrically defined shapes
so a vector graphic representation is inappropriate. The
general purpose approach is to store an image as a bitmap.
Typical uses are when capturing an existing image by
scanning or perhaps by taking a screen-shot. Alternatively,
an image can be created by using a simple drawing
package.
The fundamental concept underlying the creation of a bitmap file is that the
picture element (pixel) is the smallest identifiable component of a bitmap
image. The image is stored as a two-dimensional matrix of pixels. The pixel
itself is a very simple construct; it has a position in the matrix and it has a
colour.
Picture element (pixel): the smallest identifiable component of a bitmap
image, defined by just two properties: its position in the bitmap matrix and its
colour.
It is of no consequence as to whether it is considered to be a small rectangle,
a small circle or a dot. However, the scheme used to represent the colour has
to be decided and this can be quite detailed. The simplest option is to use one
bit to represent the colour, so that the pixel is either black or white. Storage of
the colour in four bits would allow simple greyscale colouring. At least eight
bits per pixel are necessary to code a coloured image. The number of bits per
pixel is sometimes referred to as the colour depth.
The other decision that has to be made concerns the resolution of the image
which can be represented as the product of the number of pixels per row
times the number of rows. When considering resolution it is important to
distinguish between the reso lution of a stored image and the resolution of a
monitor screen that might be used to display the image. Both of these have to
be considered if a screen display is being designed.
From the above discussion it can be seen that a bitmap file does not define t
he physical size of a pixel or of the whole image. The image is therefore
scalable but when the image is scaled the number of pixels in it does not
change. If a well-designed image is presented on a suitable screen the human
eye cannot distinguish the individual pixels. However, if the image is
magnified too far the quality of the display will deteriorate and the individual
pixels will be evident. This is illustrated in Figure 1.07 which shows an original
small image, a magnified version of this small image and a larger image
created with a more sensible, higher resolution.
Bitmap file size

The above account has considered the two approaches for storing images and
when they are appropriate.
File size is always an issue with an image file. A large file occupies more
memory space and takes longer to display or to be transmitted across a
network. A vector graphic file will have a smaller size than a corresponding
bitmap file. A bitmap file has to store the pixel data but the file must also have
a header that defines the resolution of the image and the coding scheme for
the pixel colour.
You can calculate the minimum size (the size not including the header) of a bit
map fi le knowing the resolution and the colour depth. As an example,
consider that a bitmap file is needed to fill a laptop screen where the
resolution is 1366 by 768. If the colour depth is to be 24 then the number of
bits needed is:
1366 X 768 X 24 = 25178112 bits
The result of th is calculation shows the number of bits but a file size is always
quoted as a number of bytes or multiples of bytes. Thus our file size could be
quoted as:
25 178 112 bits = 25178112 -;- 8 = 3147 264 bytes = 3147264 -;-1024 = 3073.5
kibibytes (3073.5 KiB) = 3073.5 -;-1024 = approximately 3 MiB
Kibi: a prefix representing the factor 210 (1024) written as the symbol Ki
Mebi: a prefix representing the factor 220 (1048576) written as the symbol Mi
Gibi: a prefix representing the factor 230 written as the symbol Gi

For multiples of bytes, the terminology used has recently changed. Traditionally,
computer scientists have used the terminology kilobyte, megabyte, gigabyte etc. in a
way that conflicted with the definition of these prefixes established by the
International System of Units (SI). Following the SI convention, one kilobyte would
represent 1000 bytes. Computer scientists have used one kilobyte to represent 1024
bytes. There have been a number of variations on how this was written, for example
Kbyte, KB or kB but the basic contradiction remained. In order to resolve this
unsatisfactory situation, the International Electrotechnical Commission (IEC) in 1998
proposed a new set of definitions for such quantities. 1024 bytes is now identified as
one kibibyte where the kibi can be considered as representing kilo binary. This
proposal has been accepted by other international standards bodies. For multiples of
bytes, the terminology used has recently changed. Traditionally, computer scientists
have used the terminology kilobyte, megabyte, gigabyte etc. in a way that conflicted
with the definition of these prefixes established by the International System of Units
(SI). Following the SI convention, one kilobyte would represent 1000 bytes. Computer
scientists have used one kilobyte to represent 1024 bytes. There have been a number
of variations on how this was written, for example Kbyte, KB or kB but the basic
contradiction remained. In order to resolve this unsatisfactory situation, the
International Electrotechnical Commission (IEC) in 1998 proposed a new set of
definitions for such quantities. 1024 bytes is now identified as one kibibyte where the
kibi can be considered as representing kilo binary. This proposal has been accepted by
other international standards bodies.
THANK YOU

You might also like