GCSE · Computer Science · Edexcel · Spec 1CP2

Bitmap images

Zoom into any digital photo and it falls apart into coloured squares, each one just a pattern of 0s and 1s. Count them and you can predict the file size.

Computer Science · Data representation

A picture is just a grid of pixels

4 × 4 pixels · 2-bit

4 by 4 pixel grid, 2 bits per pixel, 4 colours. Bits for the whole image: 32 bit

Paint
Colours4Bit depth2-bitBits for the whole image32 bit
Pick a colour, then click pixels to repaint them. Repaint as much as you like: watch the total. Why does it never move?

This tiny picture is 4 pixels wide and 4 pixels high, and every pixel uses 2 bits for its colour. The four codes are black = 00, red = 01, yellow = 10 and white = 11.

Calculating file size

From pixels to bits to bytes to kB

A photo is 600 pixels wide and 400 pixels high, and every pixel uses 16 bits for its colour. Work out the file size of the image, ending in kB. In this lesson 1 kB = 1000 bytes.

  1. Step 1: Total number of pixels (the resolution)
  2. Step 2: File size in bits
  3. Step 3: File size in bytes
  4. Step 4: File size in kB
  5. Final question: On your own
What you are given
QuantityValue
Width600 pixels
Height400 pixels
Colour depth16 bits per pixel
  1. Step 1 of 4: Total number of pixels (the resolution)

    How many pixels are in the whole grid?

    Give your answer to 0 decimal places. Choose its unit.

  2. Step 2 of 4: File size in bitsOpens when the step before it is right.
  3. Step 3 of 4: File size in bytesOpens when the step before it is right.
  4. Step 4 of 4: File size in kBOpens when the step before it is right.

Working backwards

Finding the number of pixels

An image file holds 480,000 bits of picture data, and it uses 8 bits per pixel. How many pixels does the image have?

  1. We know the file size (480,000 bits) and the colour depth (8 bits per pixel). We want the resolution, the total number of pixels.
  2. missing step
Which line is step 2?

What changes the file size?

Does it make the stored file bigger?

Each change below is made to a stored bitmap image. Decide whether it increases the stored file size or leaves it alone.

Still to sort

Increases the file size (0)

More pixels, more bits per pixel, or extra data stored in the file.

Where the line is: Ask: does it change the number of pixels, the bits per pixel, or add stored data?

Doesn't change the file size (0)

The stored pixels and the bits per pixel stay as they were.

Where the line is: If resolution and colour depth are untouched and nothing is added to the file, the stored size is untouched.

5 of 5 still to sort.

Quality versus file size

Low resolution, low colour depthvsHigh resolution, high colour depth

The same picture stored at two settings. The uses mentioned are examples, not rules.

Focus

File size

Low resolution, low colour depth

Smaller file

High resolution, high colour depth

Larger file

The insight

Fewer pixels and fewer bits per pixel mean fewer bits in total. Quality has a price: that is the trade-off.

Image quality

Low resolution, low colour depth

Lower quality

High resolution, high colour depth

Higher quality

When enlarged

Low resolution, low colour depth

May look pixelated

High resolution, high colour depth

Less likely to look pixelated

Example uses

Low resolution, low colour depth

e.g. web use, icons, thumbnails

High resolution, high colour depth

e.g. printing, detailed graphics

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

How a picture becomes a grid of binary codes, and how to work out how big the file is.

What you need to know

  • A bitmap image is a grid of pixels, and a pixel is the smallest element of the image.
  • Each pixel's colour is a binary sequence, and colour depth (bit depth) is how many bits each pixel uses.
  • Have a goA pixel has a colour depth of 8. How many bits does it take to store the colour of one pixel, and of three pixels?

    8 bits for one pixel, 24 bits for three.

    Colour depth counts the bits for each pixel, so every extra pixel brings its own full set of bits.

  • Resolution is the total number of pixels: 600 × 400 pixels is 240,000 pixels.
  • File size in bits = resolution (total pixels) × colour depth (bits per pixel).
  • Have a goJo says a 10 × 10 image at 4 bits per pixel is 10 + 10 + 4 = 24 bits. Jo is very confident. Can you fix it?

    10 × 10 = 100 pixels, and 100 × 4 = 400 bits.

    Resolution is the total number of pixels, so the sides multiply, and then every pixel carries its colour-depth bits. Adding the numbers counts nothing useful.

  • Divide bits by 8 to get bytes. With 1 kB = 1000 bytes, 480,000 bytes is 480 kB.
  • Rearranged, resolution = file size in bits ÷ colour depth, which gives you the number of pixels.
  • More colour depth or more resolution means a bigger file. Displaying the image smaller doesn't change the stored file size.
  • Have a goTwo photos have exactly the same resolution. One uses 8 bits per pixel and the other uses 24. Which file is bigger?

    The 24 bits per pixel photo.

    The pixel count is equal, but the second photo stores more bits for each pixel, so resolution × colour depth is larger.

  • Higher resolution and colour depth improve quality but cost file size, and the image's use guides the choice.
  • Enlarge a low-resolution bitmap and its pixels may show. That effect is called pixelation.
  • Metadata is data that describes other data, such as resolution, colour depth, a title or camera details, and it adds to the file size.

The big picture

A bitmap image is a grid of pixels, and every pixel's colour is stored as a binary sequence. The number of bits per pixel is the colour depth, and the total number of pixels is the resolution. Multiply them to get the file size in bits, divide by 8 for bytes, and rearrange the same relationship to find the number of pixels. More resolution or more colour depth means better quality and a bigger file. Displaying the image smaller changes nothing about the stored file, and metadata adds to it.

Key points

1A bitmap is a grid of pixels, and each pixel's colour is stored as a binary sequence of colour-depth bits.
2File size in bits = resolution (total pixels) × colour depth. Divide by 8 for bytes, then express it in kB using the stated convention.
3Increasing resolution or colour depth increases file size, but changing only the display size does not, and metadata adds extra stored data.
4Quality and file size pull in opposite directions, so the settings are chosen to suit the image's use.

Worked example

Problem

An icon is 100 pixels wide and 80 pixels high, with a colour depth of 4 bits per pixel. The question says to add 10% to the picture-data size to allow for metadata. Find the total size in bytes and in kB (1 kB = 1000 bytes).

⚠ Watch out

Thinking a picture shown smaller on screen has a smaller file. Stored size comes from resolution and colour depth (plus metadata). Also: the formula gives bits, so divide by 8 for bytes.

🧠

Memory hook

Pixels × bits per pixel = bits. Then ÷ 8 for bytes. Think of the image as a bag of boxes: count the boxes, count the bits each box holds, and the bag's weight never depends on how big you draw it on screen.

✓

Check yourself

Cover the page. A 20 × 10 image uses 3 bits per pixel. How many pixels is it, and how many bits is the whole image?

Flashcards

(14)
What is a pixel?
The smallest element of an image.
How is a bitmap image represented?
As a grid of pixels.
How is the colour of a pixel described?
By a binary sequence (a pattern of 0s and 1s).
What is colour depth (bit depth)?
The number of bits used to represent the colour of each pixel.
What is resolution?
The total number of pixels in the image, from its width and height in pixels.
What formula gives the file size of a bitmap image?
File size (bits) = resolution (total pixels) × colour depth (bits per pixel).
How do you convert bits to bytes?
Divide by 8, because 1 byte = 8 bits.
In this lesson, how many bytes make 1 kB?
1000 bytes. Always use the conversion the question states.
How can you find the number of pixels from the file size?
Divide the file size in bits by the colour depth.
What happens to file size if you increase the colour depth or the resolution?
The file size increases.
You only make an image display smaller. Does its stored file size change?
No. Display size isn't part of resolution × colour depth.
What is the quality and file size trade-off?
Higher resolution and colour depth improve quality but make the file bigger.
What is pixelation?
When the pixels of an enlarged image can be noticed. A low-resolution bitmap may look pixelated when enlarged.
What is metadata and what does it do to file size?
Data that describes other data, such as resolution, colour depth, a title or camera details. It is stored in addition to the image data, so it increases the 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 posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)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 21 November 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.