A photo and a logo can look alike on screen, but they are stored in completely different ways. A bitmap records the colour of every pixel; a vector graphic records a list of shapes and their properties. Learn how each is encoded, estimate bitmap file sizes and justify which to use.
A bitmap is a grid of pixels; each pixel stores a binary colour code. The colour depth (bit depth) is the number of bits per pixel, so it allows 2n colours. The image resolution is the number of pixels (width × height). A file header stores data about the image, such as its dimensions and colour depth. Estimated file size = width × height × colour depth bits. A vector graphic is a drawing list of drawing objects, each described by its properties, so it can be scaled without losing quality.
Fig. 1: a bitmap stores every pixel; a vector stores objects and their properties
Section 01
How a bitmap is encoded.
In the lab, change the resolution and the colour depth of the image. Watch the picture quality and the file size change together.
Pixel: the smallest addressable element (picture element) of a bitmap image; it has a single colour.
Colour depth / bit depth: the number of bits used for each pixel. 1 bit gives 2 colours, 8 bits give 256, 24 bits give 16 777 216.
Image resolution: the number of pixels in the image, quoted as width × height, e.g. 1920 × 1080.
Screen resolution: the number of pixels a screen can display. If the image resolution is lower than the screen area it fills, the image is enlarged and looks pixelated.
File header: data at the start of the file about the image, e.g. file type, width, height, colour depth and any compression used, so software can rebuild the grid.
Examiner trap
Do not confuse image resolution with screen resolution. Image resolution belongs to the file; screen resolution belongs to the display.
Section 02
Estimating file size.
The pixel data is width × height × colour depth bits. The header is small, so an estimate ignores it. Divide by 8 for bytes, then by 1024 for KiB and again for MiB.
Worked example Full HD photo
Estimate the file size of a 1920 × 1080 bitmap with a colour depth of 24 bits, in MiB.
Estimate the size of a 640 × 480 image with 24-bit colour, in KiB.
640 × 480 × 3 = 921 600 bytes ÷ 1024 = 900 KiB
Examiner trap
Multiplying by the number of colours instead of the colour depth is the most common error. 256 colours means 8 bits per pixel, not 256.
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
An image has a colour depth of 8 bits. How many different colours can each pixel be?
Quick check+10 XP
In the lab, what happens to the file size when the colour depth is halved?
Quick check+10 XP
What is stored in the file header of a bitmap?
Quick check+10 XP
What does a vector graphic store?
Section 03
Vector graphics.
The lab's bitmap or vector mode enlarges both kinds of image. The bitmap's pixels become blocks; the vector is redrawn from its drawing list and stays sharp.
Drawing object
Properties stored
Circle
centre (120, 80), radius 40, line colour black, line width 2, fill colour red
Rectangle
top-left (20, 20), width 200, height 30, line colour blue, fill colour none
Line
start (0, 150), end (240, 150), line colour grey, line width 1
Drawing list: the set of commands (objects) used to draw the image, stored in the file.
Scaling: the properties are recalculated, so the image can be resized without pixelation.
Bitmap or vector? Use a bitmap for photographs and images with complex colour changes. Use a vector for logos, diagrams, fonts and plans that are scaled to many sizes; the file is usually smaller for simple shapes.
Changing a bitmap: increasing resolution or colour depth improves quality but increases file size; doubling both width and height makes the file four times bigger.
Examiner trap
"Vectors are smaller" is not always true. A complex scene with thousands of objects can need a larger vector file than a bitmap, and vectors cannot realistically store a photograph.
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to AS Paper 1 and Paper 2 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
Estimate the file size of an 800 × 600 bitmap with 8-bit colour depth.
Exam style+20 XP
An image must show at least 1000 different colours. What is the minimum colour depth?
Exam style+20 XP
The width and height of a bitmap are both doubled; the colour depth is unchanged. What happens to the file size?
Exam style+20 XP
Which image is best stored as a vector graphic?
Skill unlocked
Bitmap and vector graphics, mastered.
This skill is now recorded on your profile. Keep the chain going.