SLIDE 1
CSZone.co.uk
Click to reveal · Arrow keys also work
OCR J277 · Component 1 · Topic 1.2.5

Compression

The Need for Compression · Lossy & Lossless · Effects on the File · Choosing a Method · Exam Practice

CSZone OCR GCSE Computer Science J277
Learning Objectives

By the end of this video you will be able to...

Explain the need for compression, and describe common scenarios where it may be needed
Describe lossy compression and its advantages and disadvantages
Describe lossless compression and its advantages and disadvantages
Explain the effect on the file for each type of compression
Recommend a suitable type of compression for a given scenario
⚡ The spec does not require you to know how any specific algorithm works — just the concepts and trade-offs
The Need for Compression

Why do we compress files?

KEY IDEA
Compression is the process of reducing the size of a file.
A smaller file takes up less storage space — useful when a device's storage capacity is limited.
A smaller file is also quicker to transfer over a network — for example, streaming video or music, sending email attachments, or downloading files from the internet.
⚡ Common scenarios: streaming a film, downloading a game, sending photos by email, backing up files to limited storage.
Two Types

Lossy and lossless compression

LOSSY
Some data is permanently removed from the file to make it smaller. The original file cannot be recreated exactly.
LOSSLESS
No data is removed — the file is made smaller in a way that can be reversed. The original file can be recreated exactly.
The spec doesn't require you to know how any specific compression algorithm works — just the differences in effects, advantages and disadvantages of each type.
⚡ Both reduce file size — but they make very different trade-offs.
Lossy Compression

Lossy — permanent data removal

DEFINITION
Lossy compression permanently removes some data from a file in order to reduce its size.
The data removed is often data that's hard for humans to notice — e.g. very high or low sound frequencies, or subtle colour differences in an image.
Because data is permanently removed, the process cannot be reversed — once a file has been lossy-compressed, the original version is gone for good.
⚡ Because more data can be thrown away, lossy compression usually achieves a much greater reduction in file size than lossless compression.
Lossless Compression

Lossless — fully reversible

DEFINITION
Lossless compression reduces the size of a file without permanently removing any data.
Instead of removing data, lossless compression finds smarter, more efficient ways to store the same data using less space.
Because nothing is removed, the process can be reversed — the file can be decompressed back to be exactly the same as the original.
⚡ Because no data can be thrown away, lossless compression achieves a smaller reduction in file size than lossy compression.
Effect on the File

Comparing the effects

Original
100%
Lossless
~65%
Smaller file — but exactly the same data, fully restorable.
Lossy
~25%
Much smaller file — but some data is permanently gone, not restorable.
⚡ These percentages are just for illustration. The key point: lossy gives a bigger reduction, lossless keeps the data intact.
Pros & Cons

Comparing lossy and lossless

LOSSY — ADVANTAGE
Achieves a much greater reduction in file size — saving storage space and making files faster to transfer.
LOSSY — DISADVANTAGE
Data is permanently lost — the original cannot be recovered, and quality may be noticeably reduced if compressed too much.
LOSSLESS — ADVANTAGE
No data is lost — the file can be restored to be exactly the same as the original.
LOSSLESS — DISADVANTAGE
Achieves a smaller reduction in file size — the compressed file is still larger than a lossy equivalent.
⚡ Lossy compression is unsuitable for files where every piece of data matters (e.g. source code). Lossless is essential there.
Choosing a Method

Which type fits the scenario?

USE LOSSY WHEN...
Small reductions in quality won't be noticed, and a small file size matters most — e.g. streaming music or video, photos shared online.
USE LOSSLESS WHEN...
The exact original data must be preserved — e.g. text documents, spreadsheets, executable programs, medical scans.
In the exam, you may be given a scenario and asked to recommend a type of compression — there's often no single "correct" answer, as long as your reasoning matches the type you choose.
⚡ Always link your answer to the effect on the file: "I'd choose lossy because... / lossless because..."
Exam Practice

Exam-Style Questions — Compression

Question 1 · 1 mark
Give one reason why a file may need to be compressed.
1 mark
ANS
To reduce the amount of storage space it takes up / to make it faster to transfer over a network (e.g. when streaming or downloading).
Question 2 · 2 marks
Describe what happens to the data in a file when it is compressed using a lossy method.
2 marks
ANS
Some data is permanently removed from the file. This data cannot be recovered, so the original file cannot be recreated exactly.
Question 3 · 3 marks
A user wants to email a large text document to a colleague. Recommend whether they should use lossy or lossless compression, giving a reason.
3 marks
ANS
Lossless — because every character of a text document matters exactly; lossy compression would permanently remove some data, which could corrupt the text or change its meaning.
Common Mistakes

Four mistakes that cost marks

1
Saying a lossy-compressed file can be restored to the original. It can't — that's the whole point of "lossy." Only lossless compression is fully reversible.
2
Assuming "lossy" automatically means "bad." Lossy compression is a deliberate trade-off — a much smaller file in exchange for some data loss. For many scenarios (like streaming), that's exactly the right choice.
3
Thinking lossless gives the same reduction in file size as lossy. It doesn't — because lossless can't throw any data away, it always achieves a smaller reduction than lossy.
4
Only giving "saves storage space" as the need for compression. Don't forget the other major reason: making files faster to transfer over a network, e.g. streaming or downloading.
Summary

1.2.5 — Compression

THE NEED
Compression reduces file size, saving storage space and speeding up transfer over networks.
LOSSY
Permanently removes data. Bigger file size reduction, but not reversible.
LOSSLESS
Removes no data. Smaller file size reduction, but fully reversible.
CHOOSING
Pick the type based on whether the exact original data must be preserved.
⚡ Exam tip: link every answer to the effect on the file — size, quality, and reversibility.
CSZone.co.uk

That's 1.2.5 done.

Next up: 1.3.1 — Networks and Topologies

Full quiz, marked worksheet and slides at CSZone.co.uk