1.2.5 Compression · Paper 1
Compression: making files smaller
Each section has pictures and things to try, then its key points and key words. Exam practice is at the end of the page.
You need to know
- Why files are compressed, and common situations where it's needed
- Lossy and lossless compression
- The advantages, disadvantages and effects of each
You don't need to know
- How to carry out specific compression algorithms
Why compress?
Compression makes files smaller. That means they:
Key points
Why we compress files
Before this: 1.2.3Kilobytes to petabytes
- Compression reduces file size.
- Smaller files take up less storage.
- They upload, download and send faster, and use less bandwidth.
- Streaming music and video needs compression so it plays smoothly.
- Email services often limit attachment sizes.
Key words
Say what each one means, then tap to check.
Lossy and lossless
| Lossy | Lossless | |
|---|---|---|
| How it works | Permanently removes data people are unlikely to notice | Stores the data more efficiently. Nothing is removed. |
| Can you get the original back? | No | Yes, exactly |
| File size | Much smaller | Smaller, but not by as much |
| Quality | Can drop, especially if compressed a lot | Unchanged |
| Good for | Photos, music, video (JPEG, MP3, MP4) | Text, program files, spreadsheets (ZIP, PNG) |
Exam tip: Text and program files must use lossless. Losing even one character could change the meaning or stop a program working.
Try it
Squash the photo with lossy compression.
Try it
Lossy or lossless?
- A photo to post online
- A program file
- Songs for a music app
- An essay
- A spreadsheet of exam marks
Try it
Practise an exam question. Choose the type of compression, then two reasons that fit.
- Much smaller file size
- Quicker to send, download or stream
- The lost detail is hard to notice
- Nothing is lost: the original can be rebuilt exactly
- Every bit matters: losing any could break it or change its meaning
- A video app streaming films to phones.
- An app that people download and install.
- A hospital sending X-ray scans to a doctor.
- Sharing 200 holiday photos from a phone.
- Emailing a signed contract to a lawyer.
Key points
Lossy compression
Before this: Why we compress files
- Lossy compression permanently removes some data to make the file much smaller.
- It removes data people are unlikely to notice, such as very similar colours or sounds we can't hear.
- The original cannot be restored.
- Used for photos (JPEG), music (MP3) and video (MP4).
- Too much compression gives visible or audible loss of quality.
Lossless compression
Before this: Why we compress files
- Lossless compression makes files smaller without losing any data.
- It stores the data more efficiently, e.g. recording that a colour repeats 50 times instead of storing it 50 times.
- The original file can be restored exactly.
- Files don't get as small as with lossy compression.
- Must be used for text, program code and spreadsheets, where every bit matters. Examples: ZIP, PNG.
Key words
Say what each one means, then tap to check.
Exam practice
9 questions in the style of the OCR exam, 19 marks in total. Try each one, then check the mark scheme.
Why compress?
Hint
Think about when a big file causes a problem: sending it, storing it or streaming it.
Give means give a short, clear answer. You don't need to explain it.
2 marks: make 2 separate points.
Show mark scheme
- Sending files by email (size limits).
- Streaming video / music.
- Saving storage space on a phone.
- Uploading to a website.
1 mark each, max 2
Lossy and lossless
Hint
What do you gain, and what do you lose, when data is thrown away?
Give means give a short, clear answer. You don't need to explain it.
2 marks: make 2 separate points.
Show mark scheme
- Advantage: much smaller file size.
- Disadvantage: quality is reduced / data can't be recovered.
1 mark for the advantage, 1 mark for the disadvantage.
Hint
Think about the file types used for photos, songs and videos.
Give means give a short, clear answer. You don't need to explain it.
1 mark: one answer is enough.
Show mark scheme
- JPEG / MP3 / MP4.
Don't accept: PNG or ZIP. These are lossless.
Hint
What would happen to the results if some of the data was thrown away?
Explain means say what happens and why. Words like “because” and “so” help.
2 marks: aim for 2 things said, such as a point and then the reason for it.
Show mark scheme
- No data is lost / original can be restored exactly.
- Losing any data would change the results / make them wrong.
Don't accept: "The file is smaller" on its own. Say why losing data would matter for exam results.
1 mark for each point.
Hint
Which one gives the smaller file? Which one keeps the quality?
Compare means say how the two things are similar or different. Mention both of them in each point.
2 marks: each point should mention both things.
Show mark scheme
- Lossy gives smaller files than lossless.
- Lossy reduces quality; lossless keeps the original quality.
Don't accept: Describing only one type. A compare answer must mention both.
1 mark for file size, 1 mark for quality.
Mixed questions on the whole page
Hint
Think about storage space, and sending files over the internet.
Give means give a short, clear answer. You don't need to explain it.
2 marks: make 2 separate points.
Show mark scheme
- To use less storage space.
- Faster to upload / download / transmit.
- Uses less bandwidth.
- Smoother streaming.
1 mark each, max 2
Hint
What does lossy compression throw away, and how does it choose which data?
Describe means say what it is like or what happens. Make each point a separate fact.
2 marks: make 2 separate points.
Show mark scheme
- It permanently removes data.
- It removes data that people are unlikely to notice.
- The original file cannot be restored.
Don't accept: "It stores the data more efficiently". That describes lossless compression.
1 mark each, max 2
Hint
Would it matter if one character of the code changed?
State means give a short, clear answer. You don't need to explain it.
2 marks: make 2 separate points.
Show mark scheme
- Lossless.
- No data is lost, so the code still works / is identical to the original.
Don't accept: Lossy. That gets no marks, and the reason can't get a mark either.
1 mark for lossless, 1 mark for the reason.
Hint
For each one, make a point and then say what it means for someone listening to music.
Explain means say what happens and why. Words like “because” and “so” help.
4 marks: aim for 4 things said, such as a point and then the reason for it.
Show mark scheme
- Advantage: files are much smaller…
- …so they stream faster / use less data / less buffering.
- Disadvantage: some sound quality is lost…
- …and the original quality cannot be restored.
Also accept: Advantage: the service can store more songs on its servers for less money.
Don't accept: "Data is deleted" without saying what is lost. Say that some sound quality / detail is removed.
Example answer
An advantage is that the files are much smaller, so songs stream faster and use less mobile data, with less buffering. A disadvantage is that some sound quality is lost, and the original quality can't be got back from the compressed file.
For each of the advantage and the disadvantage: 1 mark for the point, 1 mark for explaining it.