Spec & Goals 3 min
AQA Spec 3.3.6 · Representing images
By the end of this lesson you can:
- Describe a bitmap image as a grid of pixels, each storing a colour in binary.
- Define resolution and colour depth, and link colour depth to 2n colours.
- Calculate an image's file size using width × height × colour depth.
Warm-Up 5 min
Last lesson you saw that every character is stored as a number in binary. Images are stored as numbers too.
Quick starter
A black-and-white image uses only 2 colours. How many bits does each pixel need?
Reveal the answer
1 bit — 0 for black and 1 for white. Two colours need only one bit, because 21 = 2.
Key Concept — pixels, resolution and colour depth 14 min
A bitmap image is a grid of tiny squares called pixels. Each pixel stores its colour as a binary number.
Colour depth gives 2n colours
If each pixel uses n bits, the image can show 2n different colours.
| Colour depth (bits) | Number of colours (2n) |
|---|---|
| 1 | 21 = 2 |
| 2 | 22 = 4 |
| 4 | 24 = 16 |
| 8 | 28 = 256 |
Metadata
An image file also stores metadata — data about the image, such as its width, height, colour depth and the date it was taken.
Worked Example — calculating file size 12 min
Problem: a 10 × 8 image has a colour depth of 4 bits. Find its file size in bits and bytes.
Step 1 — write the formula.
| Quantity | Value |
|---|---|
| Width | 10 pixels |
| Height | 8 pixels |
| Colour depth | 4 bits/pixel |
file size (bits) = width × height × colour depth.
Step 2 — substitute and work it out.
| Step | Working | Result |
|---|---|---|
| Pixels | 10 × 8 | 80 pixels |
| Bits | 80 × 4 | 320 bits |
| Bytes | 320 ÷ 8 | 40 bytes |
Step 3 — check the colour depth meaning. A depth of 1 bit gives 21 = 2 colours; a depth of 8 bits gives 28 = 256 colours.
Try It Yourself 12 min
Goal: State how many colours an image can show with a colour depth of 3 bits.
Hint: the number of colours is 2n, where n is the colour depth.
Goal: Calculate the file size in bits of a 50 × 50 logo for a Penang café, stored at a colour depth of 2.
Hint: width × height × colour depth.
Goal: A 100 × 100 image is stored at colour depth 8. Calculate its file size in bytes, then explain what happens to the size if the colour depth doubles to 16.
📝 Exam Practice 10 min
Answer the way the examiner expects — the command word and the marks tell you how much to write.
Calculate the file size, in bits, of a 200 × 100 image with a colour depth of 3.
Mark scheme
- 200 × 100 × 3 (1).
- 60 000 bits (1).
Describe the effect on image quality and file size of increasing the colour depth.
Mark scheme
- The image can show more colours, so quality / detail improves (1).
- The file size increases / the file becomes larger (1).
Define the term metadata as used for an image.
Mark scheme
- Data about the image / data stored with the image, e.g. width, height, colour depth or date (1).
State the number of colours that can be represented by a colour depth of 4 bits.
Mark scheme
- 16 (1) — because 24 = 16.
Recap & Key Terms 3 min
A bitmap is a grid of pixels, each storing a colour in binary. Resolution is width × height; colour depth is bits per pixel and gives 2n colours. File size (bits) = width × height × colour depth. Metadata is data about the image.
- Bitmap
- An image stored as a grid of pixels, each holding a colour as a binary value.
- Pixel
- One dot in the grid; the smallest part of a bitmap image.
- Resolution
- The width × height of an image, measured in pixels.
- Colour depth
- The number of bits used to store the colour of each pixel; n bits give 2ⁿ colours.
- Metadata
- Data about the image, such as width, height, colour depth and date.
Homework 1 min
Task (≤ 15 min): A photo of the Petronas Towers is 300 × 200 pixels with a colour depth of 8. Calculate its file size in bytes.
Model answer
300 × 200 × 8 = 480 000 bits (1). 480 000 ÷ 8 = 60 000 bytes (1).