GCSE · Computer Science · AQA · Spec 8525
Bitmap representation
Every photo on your phone is secretly a list of 0s and 1s: tiny squares of colour, each stored as a code. Let's turn a picture into binary and back.
Bitmap images
Store a letter A as 0s and 1s
This tiny picture is 4 pixels wide and 4 pixels high. A pixel is one square of colour, the smallest part of the picture. In the listing, # is a black pixel and . is a white one. Step through and watch each row turn into binary.
Predict before you get there: every pixel in row 3 is black. What will its binary be?
1 KEY2 . white → 03 # black → 145 . # # .6 # . . #7 # # # #8 # . . #
| row | binary |
|---|---|
| key | 1 bit each |
Output
Step 1: First, agree a key: white is 0 and black is 1. The key is a choice, but whoever stores the picture and whoever reads it must use the same one. Two colours need only two codes, so each pixel needs just 1 bit.
Press Next to convert one row at a time. The binary builds up in the Output box.
Colour depth
Want four colours? Give each pixel two bits
Same A, now in colour. Four colours need four codes, and two bits give exactly four: 00, 01, 10 and 11. The number of bits each pixel gets is its colour depth (the readout calls it "bit depth"). Your challenge: repaint the second row so it would be stored as 11 00 00 11. Pick a swatch, tap pixels, and notice the Colours readout never moves: painting changes which code a pixel stores, not how many codes there are.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
How a picture becomes a list of 0s and 1s, and how that list becomes a picture again.
What you need to know
- A bitmap image is a grid of pixels. A pixel is one square of colour, the smallest part of the picture.
- Each pixel's colour is stored as a binary number, so the whole image is just a list of codes, one per pixel.
- A key says which code means which colour. Whoever stores the picture and whoever reads it must share that key.
- Colour depth is the number of bits used to store each pixel's colour.
- Number of colours = 2 to the power of the colour depth: 1 bit gives 2, 2 bits give 4, 8 bits give 256.
Have a goYour mate says a 7-bit colour depth gives 14 colours, "because each bit gives you two". Convinced?
No. 2⁷ = 128 colours.
Each extra bit doubles the colours rather than adding two: 2, 4, 8, 16, 32, 64, 128. Working out 7 × 2 is exactly the trap.
- In one image every code is the same length, so at 2 bits white stays 00. That's how a reader finds where pixels end.
Have a goA 2-bit image uses the key 00 = white, 01 = red, 10 = blue, 11 = black. Which colours are stored in 1101?
Black, then red (11 | 01).
Cut the bits into 2-bit codes first. Reading them one bit at a time, as if the image were black and white, finds four pixels instead of two.
- Image size is counted in pixels and written width × height: 10 × 8 means 80 pixels.
Have a goA tiny icon is 6 pixels wide and 4 pixels high. How many pixels does it have?
24 pixels.
Width × height: 6 × 4 = 24. Adding them to get 10 counts only one row and one column, not the whole grid.
- Writing an image as binary? Go row by row, left to right, copying each pixel's code from the key.
- Reading binary back? Split it into rows using the width, then into codes using the colour depth, then look each one up.
- More colour depth buys more colours; more pixels buy more detail. Both cost more data to store.
The big picture
A bitmap image is a grid of pixels, and each pixel's colour is stored as a binary code looked up in a key. Colour depth is the number of bits per pixel, and the number of colours available is 2 to the power of the colour depth. More colour depth gives more colours and more pixels allow finer detail, but both mean more data to store.
Key points
Worked example
Problem
A black-and-white bitmap image is 3 pixels wide and 3 pixels high. It uses the key 0 = white, 1 = black. Its data is 010111010. Draw the image.
⚠ Watch out
Treating colour depth as the number of colours. It looks right because both are about colour, but a colour depth of 3 means 3 bits per pixel, which gives 2³ = 8 colours, not 3.
Memory hook
Colour depth is the length of each pixel's code, not the size of the paintbox. The paintbox holds 2 to the power of that length: 1 bit, 2 paints; 2 bits, 4 paints; 3 bits, 8 paints.
Check yourself
Cover the page. What does colour depth measure? How many colours does a 2-bit colour depth allow, and what are its four codes? Does doubling an image's width and height give it more colours?
Flashcards
(13)What is a pixel?
What is a bitmap image?
What is colour depth?
How do you work out the number of colours from the colour depth?
Why does a black-and-white image need only 1 bit per pixel?
How many colours can a colour depth of 8 bits give?
What happens to the number of colours each time you add 1 bit to the colour depth?
How is the size of a bitmap image measured?
In a 2-bit image, why is white stored as 00 rather than 0?
What does increasing an image's width and height in pixels do?
What does increasing the colour depth do?
What is the key for, in a bitmap image?
Reading binary back into an image: what tells you where each row ends?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 28 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.