← IGCSE Computer Science Paper 1

Lossy compression of an image by reducing resolution or colour depth

Reduces an image's resolution or colour depth to shrink the file. Detail is lost for good. Recalculate width x height x depth to see the saving.

Understanding Lossy compression of an image by reducing resolution or colour depth in IGCSE Computer Science Paper 1

What it does: Using 8 as the colour depth instead of 24 shows the file size shrinks to one third, but the image has fewer colours and the lost colour detail is gone permanently. After recalculating width x height x depth for both versions, the difference between the before and after sizes shows how much space the lossy compression saved. Halving the width halves the pixels, and halving the height halves them again. That gives 1/2 x 1/2 = 1/4, so the file size is also one quarter.

Common mistakes: Lossy compression halves the width, so the new width is w // 2 (400). Multiplying by 2 would make the image wider and bigger, not smaller. The number of pixels is width multiplied by height (w * h), not added. Adding would give only 700 pixels instead of 120000.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 86–109) and word search (Modules 86–120).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
An image is compressed by halving both its width and its height (same colour depth). What happens to the number of pixels?
It falls to one quarter of the originalIt falls to half of the original
Matches
size = 400 * 300 * 24 / 2
↓
The student halved the width and height but then also divided by 2. Halving both dimensions gives a quarter, so the size is calculated twice over and the result is wrong.
Applying
Meanings
Term
lossy image compression
Meaning
Reduces an image's resolution or colour depth to shrink the file. Detail is lost for good. Recalculate width x height x depth to see the saving.
Practice
width ← 800
Testing
Gaps
newWidth ← / 2
Check Answer
Spots
1w = 800
2new_w = w * 2

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Chameleon' badge — Type Shifter, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. An image is compressed by halving both its width and its height (same colour depth). What happens to the number of pixels?
A. It falls to half of the original
B. It falls to one quarter of the original ✓
Halving the width halves the pixels, and halving the height halves them again. That gives 1/2 x 1/2 = 1/4, so the file size is also one quarter.
2. Which of these is lossy compression of an image?
A. Reducing the colour depth from 24 bits to 8 bits ✓
B. Storing 50 red pixels as the code 50R
Reducing colour depth throws away colour detail, so it is lossy. Storing 50R is run-length encoding, which is lossless.
3. A 100 x 50 image has a colour depth of 24 bits. It is reduced to 8 bits. What is the new file size?
A. 100 x 50 x 8 = 40,000 bits ✓
B. 100 x 50 x 24 = 120,000 bits
Recalculate with the new colour depth: 100 x 50 x 8 = 40,000 bits. The original was 120,000 bits, so the file is one third of its old size.
4. A 24-bit image is reduced to 8-bit colour. The resolution stays the same. What happens to the file size?
A. It becomes one third of the original ✓
B. It becomes two thirds of the original
8 bits is one third of 24 bits, so each pixel needs one third of the bits. The same number of pixels means the file is one third of the size.
5. A 40 x 20 image with 8-bit colour depth has its width and height halved. What is the new size?
A. 20 x 10 x 4 = 800 bits
B. 20 x 10 x 8 = 1,600 bits ✓
Only the resolution changes, so the colour depth stays at 8 bits. The new size is 20 x 10 x 8 = 1,600 bits, down from 6,400 bits.

Match the Pairs

size = 800 * 600 * 24 → The size in bits of the original image: width x height x colour depth, before any lossy compression.
size = 400 * 300 * 24 → The size in bits after the width and height are both halved, which is one quarter of the original size.
Lossy compression can reduce the colour depth from 24 bits to 8 bits, so each pixel needs a third of the bits. → size = width * height * 8
Work out the saving by subtracting the size after compression from the size before. → saving = before - after
size = 400 * 300 * 24 / 2 → The student halved the width and height but then also divided by 2. Halving both dimensions gives a quarter, so the size is calculated twice over and the result is wrong.
size = 800 * 600 * 8 * 24 → The student multiplied by both colour depths. After reducing from 24 bits to 8 bits, only the new depth of 8 should be used, not both.

Key Term

lossy image compression
Reduces an image's resolution or colour depth to shrink the file. Detail is lost for good. Recalculate width x height x depth to see the saving.

Fill in the Blanks

1. newWidth ← width / 2 newHeight ← height / 2
Hint: Type the variable that holds the original image width before it is halved.
2. newWidth ← width / 2 newHeight ← height / 2
Hint: Type the arithmetic operator that halves the height.
3. depthBefore ← 24 depthAfter ← 8 // 256 colours
Hint: Type the colour depth in bits that allows 256 colours.
4. sizeBefore ← 800 * 600 * 24 sizeAfter ← 400 * 300 * 24 saved ← sizeBefore - sizeAfter
Hint: Type the operator that works out how many bits were saved.
5. newDepth ← 8 sizeAfter ← newWidth * newHeight * newDepth
Hint: Type the variable that holds the reduced colour depth used to recalculate the size.

Spot the Error

Question 1
A w = 800
B new_w = w * 2
C h = 600
D new_h = h // 2
Line B — Lossy compression halves the width, so the new width is w // 2 (400). Multiplying by 2 would make the image wider and bigger, not smaller.
Question 2
A w = 400
B h = 300
C pixels = w + h
D after = pixels * 8
Line C — The number of pixels is width multiplied by height (w * h), not added. Adding would give only 700 pixels instead of 120000.
Question 3
A pixels = 400 * 300
B old_depth = 24
C new_depth = 8
D after = pixels * old_depth
Line D — The size after compression must use the new, reduced colour depth (8 bits). Using the old depth of 24 would give the size before compression.
Question 4
A new_depth = 8
B colours = new_depth ** 2
C print(colours)
Line B — The number of colours is 2 to the power of the colour depth: 2 ** new_depth = 256. The base and the power were swapped, which gives 64.
Question 5
A before = 800 * 600 + 24
B after = 400 * 300 * 24
C saved = before - after
Line A — Image size in bits is width x height x colour depth, so all three values are multiplied. The + should be *.

Student with a class code? Join your class →