GCSE · Computer Science · AQA · Spec 8525
Convert binary ↔ bitmap image
Every picture on your screen is really one long line of 0s and 1s. Know the width and the colour key, and you can redraw it with a pencil.
Computer Science · Bitmap images
View
Explore
This is the whole image as data: 24 bits in a row. On their own they are just 0s and 1s. To rebuild the picture you also need the width (4 pixels), the colour depth (2 bits per pixel) and the key.
Step through the four views, then pick a pixel to see which two bits made it.
Predict, then check
Every colour in the key needs its own bit pattern.
A picture needs 5 different colours, and every pixel uses the same number of bits. What is the smallest colour depth that gives each colour its own code?
Resolution and total bits
Paint it. Does the total change?
This image is 8 pixels wide and 6 pixels high, so its resolution is 8 × 6: 48 pixels. The colour depth (shown here as bit depth) is 2 bits, using the same key as before: 00 white, 01 black, 10 red, 11 yellow. Total: 8 × 6 × 2 = 96 bits.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
What you need to know
- A pixel is the smallest element of an image, and a bitmap image is a grid of pixels.
- Each pixel's colour is stored as a pattern of bits, and a key says which colour each pattern stands for.
- Colour depth is the number of bits used for each pixel. With n bits per pixel, 2ⁿ different colours are available.
- Resolution describes how many pixels an image has, from its width and height in pixels.
- An image's data is width × height × colour depth bits long.
The big picture
A bitmap image is a grid of pixels, and each pixel's colour is stored as a bit pattern that a key turns into a colour. The colour depth is the number of bits per pixel, and n bits give 2ⁿ colours. To turn binary into an image, cut the bits into colour-depth-sized groups, look each one up in the key, and fill the grid row by row from the top-left, starting a new row after "width" pixels. To go back, write each pixel's code in the same order. The data is always width × height × colour depth bits long.
Key points
Worked example
Problem
A 1-bit image is 5 pixels wide. Key: 0 = white, 1 = black. Data: 001000111000100. Draw the image.
⚠ Watch out
Using the width to decide how many bits each pixel gets. The colour depth sets the group size. The width only tells you when to start a new row.
Memory hook
Cut, key, wrap: cut by the colour depth, colour from the key, and wrap to a new row after the width.
Check yourself
Cover the page. In three steps, how would you turn 16 bits into an image 4 pixels wide with a colour depth of 2 bits? How many rows would it have?
Flashcards
(12)What is a pixel?
What is a bitmap image?
What does colour depth measure?
How many colours do n bits per pixel give?
How many colours can a colour depth of 4 bits give?
What does resolution describe?
How do you work out how many bits an image's data needs?
In a 1-bit image, what decides whether 1 is black or white?
Binary to bitmap: how many bits go in each group?
When do you start a new row of pixels?
What is the usual order for filling or reading a bitmap?
Bitmap to binary: what do you write for each pixel?
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 30 September 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.