CS5 — Bitmap and Vector Graphics
- I can describe how bitmap graphics store images as grids of pixels with binary colour values
- I can explain colour depth and resolution and use them to calculate file size
- I can describe how vector graphics store images as mathematical descriptions of shapes
- I can compare bitmap and vector graphics, identifying appropriate uses for each
- I can apply the formula: file size (bits) = resolution × colour depth, then convert to bytes, KB, or MB
- I can state that increasing colour depth or resolution increases file size
- I can name at least two attributes stored per object in a vector graphic (e.g. coordinates, colour, line thickness)
- I can justify whether bitmap or vector is more suitable for a described scenario
Key vocabulary
Notes
Bitmap graphics: pixels and colour
A bitmap graphic stores an image as a rectangular grid of pixels (picture elements). Each pixel is a single coloured dot, and its colour is stored as a binary number. When you zoom in far enough on any photo, you can see the individual square pixels.
The two key properties that determine a bitmap image's quality and file size are:
- Resolution — the total number of pixels (width × height). A 1920 × 1080 image has 2,073,600 pixels (about 2 megapixels).
- Colour depth — the number of bits used to store each pixel's colour. More bits = more possible colours.
Zoomed-in bitmap showing individual pixels — each square stores one colour value as binary data.
Colour depth and the number of colours
Colour depth determines how many distinct colours an image can contain. The formula is:
Number of colours = 2colour depth
| Colour depth | Colours available | Typical use |
|---|---|---|
| 1-bit | 2¹ = 2 | Black and white only |
| 4-bit | 2⁴ = 16 | Early colour displays |
| 8-bit | 2⁸ = 256 | Web graphics, thumbnails |
| 24-bit | 2²⁴ = 16,777,216 | Photographs, "true colour" |
24-bit colour, also called true colour, allocates 8 bits each to red, green, and blue channels. With 256 levels per channel and 256 × 256 × 256 combinations, the resulting 16.7 million colours exceeds what the human eye can distinguish — which is why it became the standard for photographic images.
Calculating bitmap file size
The uncompressed file size of a bitmap image is calculated with one formula:
File size (bits) = resolution (pixels) × colour depth (bits per pixel)
Then convert: divide by 8 to get bytes, divide by 1,024 to get KB, divide by 1,024 again to get MB.
Vector graphics: mathematics instead of pixels
A vector graphic stores an image as a set of geometric objects (shapes). Instead of recording the colour of each individual pixel, a vector file records the mathematical properties — the attributes — of each shape:
- Coordinates (x, y position)
- Dimensions (width, height, radius)
- Fill colour and opacity
- Outline (stroke) colour and line thickness
- Shape type (circle, rectangle, polygon, Bézier curve, text…)
When the image is displayed, the computer calculates exactly where to draw each shape at the required size. This is why vector images can be scaled to any size — whether a thumbnail or a billboard — without any loss of quality. The maths is simply recalculated for the new dimensions.
Same data, different format
01001101 10100110
11001010 01101101
…millions of pixel values
cx=200 cy=200
r=150
fill=#1D9E75
Advantages and disadvantages of each format
- Can represent photographic images with complex, realistic colour gradients
- Every pixel is individually editable — pixel-level retouching is possible
- Widely supported by all devices and software
- Large file sizes — every pixel must be stored
- Pixelates (becomes blocky) when scaled up — quality cannot be recovered
- File size scales directly with resolution and colour depth
- Scalable to any size without quality loss — the maths is recalculated
- Small file size for simple images (logos, diagrams, icons)
- Individual objects remain independently editable
- Cannot represent photographic images — no way to store millions of individual pixel colours
- Not suitable for complex images with subtle colour gradations
- Requires more processing power to render at display time
Worked examples
1024 × 768 = 786,432 pixels
786,432 × 24 = 18,874,368 bits
18,874,368 ÷ 8 = 2,359,296 bytes
2,359,296 ÷ 1,024 = 2,304 KB
2,304 ÷ 1,024 = 2.25 MB
786,432 × 8 = 6,291,456 bits
- Confusing resolution and colour depth in calculations: Resolution is the number of pixels; colour depth is the bits per pixel. They multiply together to give the total bits. Swapping them (e.g., writing "600 × 8 bits" when the colour depth is 600) will give the wrong answer.
- Forgetting to convert bits to bytes: The formula gives the answer in bits. Always divide by 8 to get bytes, then divide by 1,024 to get KB, and again for MB. Missing a step is the most common calculation error.
- Saying vector is "better quality" than bitmap: This is too vague and will not score marks. The correct statement is that vector graphics can be scaled to any size without loss of quality. For photographs, bitmaps are the appropriate format — vector cannot represent them at all.
- Saying bitmap files are always large: File size depends on both resolution AND colour depth. A small, low-colour-depth bitmap can be very small. Always refer to both factors.
"State one advantage of vector graphics over bitmap" is frequently asked. The answer that scores marks is: "Vector graphics can be scaled to any size without loss of quality." Writing just "better quality" or "clearer image" is too vague and will not score. You must include the phrase without quality loss (or without pixelation, or without degradation).
For file size questions, lay out every step. A correct final answer with no working shown may lose a method mark. Always show: pixels → bits → bytes → KB or MB.
Task Set A
Task Set B
Higher Computing Science → Computer Systems → CS5
Timing (120 min double):
5 min — warm up (CS4 recap), circulate
5 min — key vocabulary together
10 min — bitmap: pixels, colour depth, resolution — use the pixel demo on screen, zoom into a photo on the projector
10 min — file size formula — worked example 1 together on board; pupils verify with their own calculator
5 min — worked example 2: effect of colour depth on file size
10 min — vector graphics: what is stored, contrast with bitmap, context-clash diagram
5 min — comparison cards: when to use each
5 min — now you try, then cold call
5 min — common mistakes and exam tip
25 min — tasks
5 min — cold call on A7/A8 (most exam-relevant)
Watch for: pupils who multiply resolution × colour depth but forget to divide by 8 to get bytes. Also watch for pupils who say vector is "always better" — always redirect to "better for what?" Photographs cannot be stored as vectors.
Practical demo: Open a photo in an image editor, zoom to 400%, and show individual pixels. Then open an SVG logo, scale it to 3000% — no pixelation. This is more memorable than any diagram.
A10 bridges neatly into why compressed video formats (MP4, H.264) exist — worth a brief mention even if pupils don't attempt the extension. The contrast between 177 MB/s uncompressed vs real-world H.264 at ~5 MB/s is striking.