GCSE · Computer Science · AQA · Spec 8525
Bitmap file size calculation
Zoom into a digital image and it breaks into tiny squares, each stored as a short binary code. Know the code's length and you can size the whole image.
Computer Science · Bitmap images
Paint it however you like. Watch the file size.
Each of the four colours has its own 2-bit code: 00 is white, 01 is yellow, 10 is black and 11 is red. The grid is 8 pixels wide and 8 pixels high, so that's 64 pixels, and every one of them stores a 2-bit code. That code length, the number of bits per pixel, is called the colour depth. 64 × 2 = 128 bits, and 128 ÷ 8 = 16 bytes. Repaint the whole face and the number doesn't move.
Computer Science · Colour depth
Why each extra bit doubles the colours
Every bit is a two-way choice: 0 or 1. Walk down the tree and build a 3-bit colour code, then count how many different codes there are.
1st bit → 2nd bit → 3rd bit
Each bit you add is a new choice: 0 or 1.
2 × 2 × 2 = 8 different 3-bit codes, and the tree ends 8 times.
Keep going and the pattern never breaks: 4 bits give 16 colours and 8 bits give 256. Each new bit splits every existing code in two, so n bits give 2ⁿ different colours.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Count the pixels, multiply by the bits each one uses, then divide by 8 for bytes.
What you need to know
- A bitmap image is a grid of pixels (picture elements), and each pixel's colour is stored as a binary code.
- Image size is the width in pixels multiplied by the height in pixels.
- Colour depth is the number of bits used to store the colour of each pixel.
- A colour depth of n bits can represent 2ⁿ different colours.
- File size in bits = width × height × colour depth. Divide by 8 to get bytes, because 1 byte = 8 bits.
The big picture
A bitmap image is a grid of pixels, and each pixel's colour is stored as a binary code. Every code in the image is the same length, and that length is the colour depth. File size in bits = width × height × colour depth; divide by 8 to get bytes. A colour depth of n bits gives 2ⁿ colours. More pixels or more bits per pixel means a bigger file, and fewer means a smaller one.
Key points
Worked example
Problem
An image is 40 pixels wide and 25 pixels high, and it can show 16 different colours. Calculate its file size in bytes.
⚠ Watch out
Putting the number of colours into the formula instead of the colour depth. For a 256-colour image, multiply by 8 (the bits per pixel), not by 256.
Memory hook
Count them, cost them, byte them: count the pixels (width × height), cost them (× bits per pixel), then byte them (÷ 8).
Check yourself
A 10 × 10 image can show 8 colours. What is its file size in bits? (Answer: 8 = 2³, so 3 bits per pixel; 100 × 3 = 300 bits.)
Flashcards
(12)What is a pixel?
How is the colour of each pixel stored?
How do you work out the image size of a bitmap, in pixels?
What is colour depth?
How many colours can a colour depth of n bits represent?
How many colours does a colour depth of 8 bits give?
What colour depth do you need for 32 colours?
What is the formula for the file size of a bitmap image in bits?
How do you turn a file size in bits into bytes?
An image's width and height are both doubled. What happens to its file size?
An image's colour depth is doubled but its size in pixels stays the same. What happens to its file size?
Does repainting pixels in different colours change a bitmap's file size?
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.