A-Level Presentation - 31A Images
A-Level Presentation - 31A Images
A-Level
Images
teachcomputerscience.com
2
Lesson Objectives
teachcomputerscience.com
1.
Content
teachcomputerscience.com
4
teachcomputerscience.com
5
teachcomputerscience.com
6
Bitmaps
▪ Bitmap images, also known as pixel maps or raster graphics, are made
of an organised grid of coloured squares called pixels.
▪ When bitmaps are enlarged or zoomed in, the pixels are over-
stretched, and the image loses quality.
▪ JPEG, GIF and PNG are a few examples of bitmaps. These file formats
are widely used in digital cameras and smartphones.
▪ The colour of each pixel in an image is stored as a binary value. For a
black-and-white image, the colour white is represented using the
binary value 1 and black is represented using 0.
teachcomputerscience.com
7
Vectors
▪ A vector uses coordinates and geometrical shapes such as lines and
curves to define an image.
▪ Hence, a vector image is more efficient than a bitmap image, as it
needn’t store a binary value for each pixel.
▪ Vector images do not lose resolution when scaled.
▪ A vector image contains a drawing list in its file header. It consists of:
• A command that describes the shape of the object
• Attributes of each object such as position, line colour, the
thickness of a line, fill colour
teachcomputerscience.com
8
Vectors
▪ A vector uses coordinates and geometrical shapes such as lines and
curves to define an image.
▪ Therefore, a vector image is more efficient than a bitmap image as it
needn’t store a binary value for each pixel.
▪ Vector images do not lose resolution when scaled.
▪ Scalable Vector Graphics (SVG) is an example of a vector image. It is an
open standard.
▪ Vector graphics are widely used in animated movies, Adobe Portable
Document Format (PDF), AutoShapes in MS-Office, etc.
teachcomputerscience.com
9
Vectors
▪ For example,
• Circle (centre = 0,0; radius = 5; fill = green; bordercolour = black;
weight = 2 px)
• Rectangle (position = 3,10; width = 10; height = 5; fill = blue;
bordercolour = None)
▪ When vector images are printed, they are converted to bitmap image
so that image matches the format supported by printers.
▪ Scalable Vector Graphics (SVG) is an example of a vector image. It is an
open standard. Vector graphics are widely used in animated movies,
Adobe Portable Document Format (PDF), AutoShapes in MS-Office, etc.
teachcomputerscience.com
10
Bitmap Vector
Uses coordinates and geometrical
Made of tiny pixels shapes such as lines and curves to
define an image
When bitmaps are enlarged or zoomed Vector images do not lose
in, the pixels are over-stretched, and resolution when scaled.
the image loses quality.
To edit vector images, the
Pixels can be edited without changing geometric shape needs to be
the design of the image. changed. Individual pixels cannot
be modified.
Does not require a large file size.
Larger file size
Easier to transmit or load.
The image is more realistic. Image is not very realistic. teachcomputerscience.com
11
teachcomputerscience.com
13
Storing a black-and-white
image
▪ The computer stores
binary value 1 for white
and binary value 0 for
black for each row of the
image.
▪ This process becomes
complex when the number
of rows and columns of the
image increases, and
different colours are
included. teachcomputerscience.com
14
Colour Depth
Binary code Colour
▪ Colour depth is the number of bits
used to indicate the different colours 00 Black
of a pixel.
01 Dark grey
▪ In case of a black-and-white image,
10 Light grey
the colour depth is 1.
▪ A 2-bit colour depth can represent 11 White
four different colours.
teachcomputerscience.com
15
Colour depth
teachcomputerscience.com
17
Resolution
▪ The image resolution is the number of pixels that make up an
image.
▪ Screen resolution is the number of horizontal pixels and the
number of vertical pixels that make up a screen display.
▪ For example, if the screen resolution is lower than the image
resolution, the image will be displayed at a lower quality by
removing some pixels or cropping the image or sometimes,
rotating the image. However, the image with lower resolution
gets pixelated when we try to zoom in or enlarge it.
teachcomputerscience.com
18
Resolution
▪ The pixel density of an image is measured in dots per inch or
pixel per inch. It is the number of pixels or dots in a unit.
▪ Magazines and books have higher resolution compared to the
images on a computer screen.
▪ An image on a website usually has a resolution of 72 dpi. An
image in a book has a resolution of 300 or even 600 dpi.
▪ An image with a resolution of 300 dpi contains a grid of 300
pixels wide and 300 pixels high in a grid.
teachcomputerscience.com
19
Resolution
teachcomputerscience.com
20
Pixel density
▪ Pixel density for a screen is calculated using the following
steps.
▪ Calculating the pixel density of Samsung Galaxy S10 phone
which has a resolution of 1440 × 3040 pixels and a 6.1 inches
display
i. Add the squares of resolution sizes, 14402 + 30402 = 11315200
ii. Taking the square root of the result in (i), √11315200 = 3363.81
iii. Divide by the screen size, 3363.81 ÷ 6.1 = 551 ppi (pixels per
square inch) teachcomputerscience.com
21
teachcomputerscience.com
22
4540960 ÷ 8 =
height = 1010 pixels, File size =
567620 bytes =
width = 562 pixels & 1010 × 562 × 8 =
0.568
colour depth = 8 bits. 4540960 bits
megabytes
teachcomputerscience.com
23
Compression
teachcomputerscience.com
24
Metadata
Metadata is ‘data about data’. An image file has metadata that
stores information such as:
▪ Filename and format
▪ Dimensions, resolution & colour depth of the image
▪ Date and place when the photo was taken
▪ Time and date when the photo was changed
▪ Camera settings when the photo was taken
teachcomputerscience.com
25
Metadata
▪ Photos captured using a mobile
phone when GPS is ON,
automatically stores the location
exactly where this photo is taken.
▪ With an image’s metadata, we can
find the date, time and location
where a photo was captured.
▪ A part of the metadata is shown.
teachcomputerscience.com
26
Pixel density
Colour Depth Resolution It is the number of pixels or dots
Colour depth is the number of The image resolution is the in a unit.
bits used to indicate the different number of pixels that make up
colours of a pixel. an image. Screen resolution is
the number of horizontal pixels Metadata
An image with colour depth n
and the number of vertical pixels Metadata is ‘data about data’.
can represent 2n different
that make up a screen display.
colours.
teachcomputerscience.com
2.
Activity
teachcomputerscience.com
28
Activity-1
Duration: 10 minutes
1. Estimate the file size of an image file with the height of 1210
pixels, width of 729 pixels and a colour depth of 16 bits.
2. The actual size of an image file in question 1 that is stored in a
computer is less than the calculated value. Why?
3. How many different colours can be represented by a colour
depth of 16 bits?
teachcomputerscience.com
3.
End of topic questions
teachcomputerscience.com
30
teachcomputerscience.com
31
teachcomputerscience.com