1.2-Multimedia-Notes-By-EMK_2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

1.

2 Multimedia Notes

Objective:
 Show understanding of how data for a bitmapped image are encoded.
 Use and understand terms: pixel, file header, image resolution, screen resolution, colour
depth, bit depth.
 Perform calculations to estimate file size for a bitmap image.
 Show understanding of effects of changing elements of a bitmap image on image quality and
file size. Use the terms: image resolution, colour depth
 Show understanding of how data for a vector graphic are encoded. Use terms: drawing
object, property, drawing list.
 Justify use of a bitmap image or a vector graphic for a given task.
 Show understanding of how sound is represented and encoded. Use terms: sampling,
sampling rate, sampling resolution, analogue and digital data
 Show understanding of impact of changing sampling rate and resolution. Impact on file size
and accuracy.

Graphics
Images can be stored in a computer in two common formats:
➢ Bit-map image
➢ Vector graphic.

Bit-Map Images

Bit-map images are made up of pixels (picture elements). Image is stored in a two
dimensional matrix of pixels. Each pixel can be small rectangle, a small circle or a dot.

Picture element (pixel) are smallest identifiable component of a bitmap image, defined
by just two properties: its position in the bitmap matrix and its colour.
Bitmaps are also known as pixelmaps or raster graphics.
Use: Bitmap images are widely used on digital cameras, smartphones and online.

Simplest scheme used to represent the colour 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 allows simple greyscale colouring.

Greyscale
 At least 8 bits ( per pixel are needed to code coloured image, this will gives 256
possible colours by varying the intensity of the blue, green and red elements.

O-A level Computer Science by Engr Muhammad Kashif 03345606716 paperscambridge.com


Graphics & Sound

 True colour requires 3 bytes per pixel (24 bits), which gives more than one
million colours.
 Colour Depth:
Number of bits used to represent one pixel is known as colour depth.
Colour depth of 8 bits per pixel provides 256 different colours. When colour depth
increases, number of possible colours which can be represented also increases.
 Bit Depth:
Bit depth is number of bits used to store each of red, green and blue primary
colours in RGB colour.
When bit depth increases, number of possible colours which can be represented also
increases. A bit depth of 8 bits (28) per primary colour (Red , Green , Blue ) provides
256 × 256 × 256 = 16 777 216 different colours.
If a lower bit depth is used, image will show bands of colour.
Note: Colour depth and bit depth term can be used interchangeably.
 Image resolution:
It is number of pixels in bitmap file defined as product of width and height values.

 Screen Resolution:
Product of width and height values for number of pixels that the screen can display.
If screen resolution is smaller than image resolution then whole image cannot be
shown on screen or the original image will now be a lower quality.
 Pixel Density:
Number of pixels per square inch is known as pixel density.
ESQ: Why bitmap image quality become poor during zooming?
Bitmap images are organized as a grid of coloured squares called pixels. Image is therefore
scalable but when image is scaled the number of pixels in it does not change. When
zooming in or enlarging a bitmap image, pixels are stretched and made into larger blocks.
This is why bitmap images appear as poor quality when enlarged too much. Enlarging a
bitmap image causes it to look blocky and "pixelated."
 File Size:
Large file occupies more memory space and takes longer to display or
to be transmitted across a network.
Calculating size of a Bitmap Graphic:
Consider that a bitmap graphic is needed to fill a laptop screen where
resolution is 1366 by 768. If colour depth is 24 then number of bits we need is:
1366 × 768 × 24 = 25 178 112 bits

Computer Science IGCSE, O & A level By Engr M Kashif 03345606716


1.2 Multimedia Notes

25 178 112 ÷ 8 = 3 147 264 bytes


3147 264 ÷ 1024 = 3073.5 kibibytes (3073.5 KiB)
= 3073.5 ÷ 1024 = approximately 3 MiB
Note in above calculation, colour depth was given. If information given was that bit depth was 8,
then calculation would use 8 + 8 + 8 for number of bits per pixel.

Example:
Calculate minimum size of bitmap file. Bitmap is to use a bit depth of 8 and bitmap is
to be printed with 72 dpi (dots per inch) and to have dimensions 5 inches by 3 inches.
Solution:

To find number of bits per pixel in image we need to know value of colour depth or bit
depth. In this case we know value of bit depth. i.e 8 bit which means 8 bits for each of RGB
components, so 24 bits are needed for one pixel.

72 dpi means 72 pixels per inch so,


Number of pixels per row is 5 × 72 = 360
And number of pixels per column is 3 × 72 = 216

Total number of pixels is 360 × 216 = 77 760


For total number of bits, multiply total number of pixel by 24 bit or 3 Byte.
77 760 × 3 = 233 280 bytes.
233 280 / 1024 = 227.8 KiB
 Bitmap File Header:
A set of bytes at beginning of a bitmap file which identifies the file type and contains
information about the coding used. File header define colour depth or bit depth and
image resolution of image. It also contain information about type of compression
used and dimension of image e.g ( 100 * 100 Pixel ).

ESQ: Why bitmap file size is larger than the size of the graphic alone?
A bitmap file store pixel data that defines the graphic and also have a file header that
contains information on how the graphic has been constructed.

ESQ: What Are File Headers?


File header is a ‘signature’ placed at the beginning of a file, so operating
system and other software know what to do with the following contents.
Many applications (computer programs) use the file header as a means to verify file types.

Drawback of using high resolution images:

O-A level Computer Science by Engr Muhammad Kashif 03345606716 paperscambridge.com


Graphics & Sound

High resolution will increase file size. As number


of pixels used to represent image is increased, size of file will also increase. This
impacts on how many images can be stored on a hard drive. It also impacts on time to
download an image from internet or time to transfer images from device to device.
Vector Graphics
A vector image uses scalable shapes such as straight lines and curves, using
coordinates and geometry to precisely define the parts of the image.

Vector graphics can be designed using computer aided design (CAD) software or using
an application which uses a drawing canvas on the screen.
A vector graphic will contain a drawing list (included in file header) that is made up of
 The command used for each object that makes up the graphic image.
 The attributes that define the properties that make up each object
 The relative position of each object will also need to be included.
 The dimensions of each object are not defined, but the relative positions of
objects to each other in the final graphic need to be defined; this means that
scaling up the vector graphic image will result in no loss of quality.
A vector graphic file will have a smaller size than a corresponding bitmap file.

Comparison between Vector Graphics and Bit-map images


Vector graphic images Bit-map images
Made up of geometric shapes which require Made up of tiny pixels of different colours
definition/attributes
to alter/edit the design, it is necessary to possible to alter/edit each of the pixels to
change each of the geometric shapes change the design of the image
they do not require large file size since it is because of the use of pixels (which give very
made up of simple geometric shapes accurate designs), the file size is very large
because the number of geometric shapes is since images are built up pixel by pixel, the
limited, vector graphics are not usually very final image is usually very realistic
realistic
file formats are usually .svg, .cgm, .odg file formats are usually .jpeg, .bmp, .png
Does the image need to be drawn to scale? Vector graphic is the best option.

Computer Science IGCSE, O & A level By Engr M Kashif 03345606716


1.2 Multimedia Notes

Vector graphic file can only be displayed directly on a graph plotter, which is an
expensive specialised piece of hardware. For the image to appear correctly on other
types of display, vector graphic file often has to be converted to a bitmap.

What happen when vector graphic is displayed ?


Whenever image is to be displayed, file is read, appropriate calculations are made and
Does the image need to look real? Usually bit-map images look more realistic than
objects are drawn to a suitable scale. If the user then requests that the image is
vector graphics.
redrawn at a larger scale the file is read again and another set of calculations are made
before the image is displayed. This avoids image distortion, such as the image
appearing squashed or stretched.

When designing a logo for a company or composing an ‘exploded diagram’ of a car


engine, vector graphics are the best choice

A digital camera automatically produces a bitmap. A bitmap file is the choice for
insertion of an image into a document, publication or web page.

Vector graphic is chosen if a diagram is needed to be constructed for part of


architectural, engineering or manufacturing design. • If a vector graphic file has been
created but there is a need to print a copy using a laser or inkjet printer, file has first to
be converted to a bitmap.

Sound
Sound cannot travel in a vacuum. It requires a medium to travel. It is transmitted by
causing oscillations of particles within medium. Human ear picks up these oscillations
(changes in air pressure) and interprets them as sound.

Each sound wave has frequency and wavelength; amplitude specifies loudness of
sound. Amplitude of sound varies in a continuous but irregular pattern.

How Sound is transmitted electronically or stored in computer?


Original analogue sound signal has to be converted to a binary code. Measured sound
values are input to a sound encoder which has two components.
First Component is a band-limiting filter which is used to remove high frequency
components. A human ear cannot detect these very high frequencies and they could cause
problems for coding if not removed. Other component in encoder is an analogue-to-digital
converter (ADC) which converts analogue data to digital data.

Does the image need to be resized? If so, a vector graphic could be the best option.

O-A level Computer Science by Engr Muhammad Kashif 03345606716 paperscambridge.com


Graphics & Sound

Analogue data is data obtained by measurement of a physical property which can have
any value from a continuous range of values. Digital data is data that has been stored as
a binary value which can have one of a discrete range of values

Sampling is taking measurements at regular intervals and storing the value.

Sampling Resolution is number of bits used to store each sample. Larger sampling
resolution will mean there are more values available to store each sample. Larger
sampling resolution will improve accuracy of digitised sound and decrease distortion
of sound. Increased sampling resolution means a smaller quantization error.

Sampling Rate is number of samples taken per second. Increasing sampling rate will
increase accuracy / precision of digitised sound. Increasing sampling rate will result in
smaller quantisation errors.
Sampling rate should be in accordance with Nyquist’s theorem which states that sampling
must be done at a frequency at least twice highest frequency of the sound in sample.

Higher sampling rate and/or sampling resolution, greater the file size and will result in a
more faithful representation of original sound source.
16-bit sampling resolution is used when recording CDs to give better sound quality.

 Pros and cons of using a larger sampling resolution

Computer Science IGCSE, O & A level By Engr M Kashif 03345606716


1.2 Multimedia Notes

 Features of sound Editor Software:


edit the start/stop times and duration of a sample
extract and save (or delete) part of a sample
alter the frequency and amplitude of a sample
fade in and fade out
mix and/or merge multiple sound tracks or sources
combine various sound sources together and alter their properties
remove ‘noise’ to enhance one sound wave in a multiple of waves
Convert between different audio formats.

***************************
Exam Style Question
ESQ:1 Photographs has a bit depth of 8 bytes and image resolution of 1500 pixels
wide and 3000 pixels high. Calculate file size of photograph in megabytes. Jun 23 P11
Ans: Total Pixel = 1500 * 3000 = 4500000
image Size = (4500000 * 8 )/1000 /1000 = 36 MB

ESQ:2 Describe how sound is represented in computer. Jun 23 P13


Ans: Amplitude is recorded a set number of times a second. Each amplitude is given a
corresponding binary number. Binary number of amplitude is saved in sequence.

ESQ# 3: Camera detector has an array of 1920 by 1536 pixels. Colour depth of 16bits
is used. Calculate size of photograph , giving your answer in MiB.
Ans: 1920 × 1536 = 2 949 120 pixels
colour depth = 16
16 × 2 949 120 = 47 185 920 bits
bits (÷ 8) → 5 898 240 bytes → (÷ (1024 × 1024)) → 5.625 MiB
ESQ #4 Photographs have been taken by a smartphone which uses a detector with a
1024 × 1536 pixel array. Software uses a colour depth of 24bits. How many
photographs could be stored on 16GiB memory card?
ANS: 1024 × 1536 = 1 572 864 pixels
colour depth = 24 → 24 × 1 572 864 = 37 748 736 bits
bits (÷ 8) → 4 718 592 bytes → 16 GiB = 17 179 869 bytes
number of photos = (17 179 869)/(4 718 592) = 3640 photos
ESQ#4: Audio is being sampled at the rate of 44.1 kHz using 8 bits. Two channels
(Stereo) are being used. Calculate: the size of a 30-second audio recording in MiB.
ANS: file size = 44 100 × 8 × 30 × 2 (two tracks) = 21 168 000 bits
21 168 000 bits (÷ 8) → 2 646 000 bytes → 2646000 / (1024 *1024) = 2.5 MiB

O-A level Computer Science by Engr Muhammad Kashif 03345606716 paperscambridge.com

You might also like