GCSE · Computer Science · AQA · Spec 8525

Image size (width x height)

Zoom into a photo and it becomes a grid of tiny squares, each stored as a binary number. So how much space does the whole picture take? Let's count.

Computer Science · Representing images

Every square is a number

8 × 6 pixels · 2-bit

8 by 6 pixel grid, 2 bits per pixel, 4 colours. Bits stored: 96 bit

Paint
Colours4Bit depth2-bitBits stored96 bit
pick a colour, then paint

Each square is a pixel, short for picture element. This picture is 8 pixels wide and 6 pixels high, so its size is written 8 × 6. Every pixel holds a 2-bit code: 00 cream, 01 navy, 10 red, 11 yellow. The number of bits each pixel gets is called the colour depth. Repaint as many pixels as you like, and keep an eye on the Bits stored readout.

Watch it done: an icon's file size

Problem

A small icon is 40 pixels wide and 25 pixels high, with a colour depth of 4 bits. Calculate its file size in bytes. Ignore any extra data stored with the image.

Your turn

Fill in the missing steps

A thumbnail is 60 pixels wide and 20 pixels high, with a colour depth of 6 bits. Find its file size in bytes.

  1. Width = 60 pixels, height = 20 pixels, colour depth = 6 bits per pixel.
  2. missing step
Which line is step 2?

Predict, then check

Commit to an answer before you look.

An image is 100 × 50 pixels with a colour depth of 8 bits. Its file size is 5,000 bytes. It's saved again at 200 × 100 pixels, still at 8 bits. What's the new file size?

Spot the slip

Where does this answer go wrong?

An image is 30 pixels wide and 20 pixels high. It can show 16 different colours. Calculate its file size in bytes.

A student's answer — which line goes wrong?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Count the squares, then count the bits inside each one. The file size falls out of two multiplications and one division.

What you need to know

  • What a pixel is, and how a bitmap image stores colours as binary
  • How to write an image's size as width × height, and find its total number of pixels
  • What colour depth means, and how many colours n bits per pixel can show
  • How to calculate a bitmap's file size in bits and in bytes
  • What happens to the file size when the width, height or colour depth changes

The big picture

A bitmap image is a grid of pixels, and each pixel stores its colour as a binary value. The image's size is written as width × height in pixels, and multiplying the two gives the total number of pixels. Every pixel uses the same number of bits, called the colour depth, and n bits give 2ⁿ possible colours. So the file size in bits is width × height × colour depth, and dividing by 8 turns it into bytes (ignoring any extra data stored with the image).

Key points

1A bitmap image is a grid of pixels (picture elements). Each pixel stores its colour as a binary value.
2Image size is written as width × height in pixels, width first. An 800 × 600 image is 800 pixels wide and 600 pixels high.
3Total pixels = width × height, so an 800 × 600 image has 480,000 pixels.
4Colour depth is the number of bits used for each pixel. With n bits you get 2ⁿ colours: 4 bits give 16 colours and 8 bits give 256.
5File size in bits = width × height × colour depth. Divide by 8 to get bytes. This ignores any extra data stored with the image.
6Every pixel costs the same number of bits, whatever colour it is.
7Doubling both the width and the height gives 4 times as many pixels, so 4 times the file size. Doubling the colour depth doubles the file size.

Worked example

Problem

Image A is 400 × 300 pixels with a colour depth of 8 bits. Image B is 200 × 150 pixels with a colour depth of 24 bits. Which image has the bigger file size, and by how many bytes? Ignore any extra data stored with the images.

⚠ Watch out

Multiplying by the number of colours instead of the colour depth. An image that can show 256 colours uses 8 bits per pixel, because 2⁸ = 256, so you multiply by 8, not by 256.

🧠

Memory hook

Squares, bits, bytes. Count the squares (width × height), fill each one with bits (× colour depth), then pack the bits into bytes of 8 (÷ 8).

✓

Check yourself

An image is 12 × 10 pixels with 1 bit per pixel. How many colours can it show, and what is its file size in bits and in bytes? What changes at 2 bits?

Flashcards

(13)
What is a pixel?
Short for picture element: one of the tiny squares in the grid that makes up a bitmap image.
How does a bitmap image store its colours?
Each pixel stores its colour as a binary value.
How do you write the size of a bitmap image?
Width × height, in pixels, width first. For example, 800 × 600.
How do you find the total number of pixels in an image?
Multiply the width in pixels by the height in pixels.
What is colour depth?
The number of bits used to store the colour of each pixel.
With a colour depth of n bits, how many colours are possible?
2ⁿ colours. For example, 3 bits give 2³ = 8 colours.
What colour depth do you need for 256 colours?
8 bits, because 2⁸ = 256.
What is the formula for a bitmap's file size in bits?
Width × height × colour depth.
How do you turn a size in bits into bytes?
Divide by 8, because 8 bits make 1 byte.
Width and height are both doubled. What happens to the file size?
It becomes 4 times as big, because there are 2 × 2 = 4 times as many pixels.
The colour depth is doubled. What happens to the file size?
It doubles. There are the same number of pixels, but each one holds twice as many bits.
Does repainting pixels in different colours change the file size?
No. Every pixel uses the same number of bits, whatever colour it is.
What does the width × height × colour depth calculation leave out?
Any extra data stored with the image, sometimes called metadata.

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 posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

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.