Year 9 · Spring 2
Representations: going audio-visual · Lesson 1 of 5
Pixels and colour depth
TheoryTopic 5 Representing images
Year 9 · Representations: going audio-visual · Lesson 1 of 5
You will learn to
- Explain that a bitmap image is a grid of pixels, each stored as a binary number.
- Calculate how many colours n bits give, using 2 to the power n.
- Decode a row of bits into pixels, using a colour key.
- Explain why a bigger colour depth means a bigger file.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Success criteria
You have got it when you can say:
- I can paint a 1-bit image, then an 8-colour image, in the pixel toy.
- I can say that 3 bits give 8 colours and 8 bits give 256.
- I can turn a row of bits into the right row of pixels.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Retrieval starter
Questions from before. Write your answers, then show them.
- Last unit
The numbers 3, 9, 4, 4, 10. What is the median?
A 4B 9C 6
A. 4
- Last unit
=B2*C2 in D2 is filled down to D5. What is in D5?
A =B5*C5B =E2*F2C =B2*C2
A. =B5*C5
- Earlier this year
A variable made inside a function is…
A Saved to a fileB Local: only exists inside it while it runsC Global: usable anywhere
B. Local: only exists inside it while it runs
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Key words (1 of 2)
- pixel
- The smallest single-colour dot of an image.
- bitmap
- An image stored as a grid of pixels.
- colour depth
- Bits per pixel. Sets how many colours are possible.
- Resolution
- Number of pixels: width × height.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Key words (2 of 2)
- Metadata
- Data about data, like an image's width and height.
- Vector
- An image stored as shapes and instructions.
The explanation · step 1 of 3
Pixels
Zoom right into a photo and it becomes little squares. Each is a pixel: the smallest dot of one colour. This kind of image is a bitmap.
The explanation · step 2 of 3
More colours = more bits per pixel
Bits per pixel = colour depth. Same rule as before: n bits give 2ⁿ colours.
| Colour depth | Colours | Use |
|---|---|---|
| 1 bit | 2 | Black and white |
| 2 bits | 4 | Very early games |
| 8 bits | 256 | GIFs, retro graphics |
| 24 bits | about 16.7 million | Normal photos |
The explanation · step 2 of 3
The maths: How many colours?
The explanation · step 3 of 3 · part 1 of 2
How 24-bit colour works (RGB)
Screens mix three lights: Red, Green, Blue. Each gets 1 byte (0–255). 3 × 8 = 24 bits.
| Colour | Red | Green | Blue | Hex |
|---|---|---|---|---|
| Black | 0 | 0 | 0 | #000000 |
| White | 255 | 255 | 255 | #FFFFFF |
| Red | 255 | 0 | 0 | #FF0000 |
| Yellow | 255 | 255 | 0 | #FFFF00 |
| Orange | 255 | 128 | 0 | #FF8000 |
The explanation · step 3 of 3 · part 2 of 2
How 24-bit colour works (RGB) (continued)
Why is red + green = yellow? Mixing light adds colours. Mixing paint takes them away. Screens make light.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Try it: Paint pixels
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Quick quiz · 1 of 3
A colour depth of 2 bits gives how many colours?
- A 8
- B 2
- C 4
C. 4
2 × 2 = 4: the codes 00, 01, 10, 11.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Quick quiz · 2 of 3
A 10 × 10 black-and-white image needs…
- A 10 bits
- B 20 bits
- C 100 bits
C. 100 bits
100 pixels × 1 bit = 100 bits.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Quick quiz · 3 of 3
Double the width and the height. The file becomes…
- A 4 times bigger
- B 2 times bigger
- C 8 times bigger
A. 4 times bigger
2 × 2 = 4 times the pixels, so 4 times the bits.
Year 9 · Representations: going audio-visual · Lesson 1 of 5
Exit ticket
Answer on paper before you go. Then check.
You need 300 different colours. The smallest colour depth is…
A 300 bitsB 8 bitsC 9 bits
C. 9 bits 2⁸ = 256 is too few. 2⁹ = 512 is enough.
In #00FF00, which light is on?
A RedB BlueC Green
C. Green The pairs are RR GG BB. Only the middle pair (green) is FF = 255.