GCSE · Computer Science · Edexcel · Spec 1CP2
Lossless compression
Squash a file down, send it, unsquash it. Has anything changed? With lossless compression the answer is a very satisfying 'nope, not one bit'.
Computer Science · Data compression
Lossless or lossy: you decide
Sort each file into the compression it needs. Commit, then check the reason.
Still to sort
Must be lossless (0)
The exact original has to come back.
Where the line is: If the file must be perfectly preserved, it lives here. Lossless keeps all the data, so decompressing gives back exactly what you started with.
Lossy is acceptable (0)
A slight loss of quality is fine for a smaller file.
Where the line is: Lossy generally gives a smaller file but removes data and may reduce quality. It only belongs here when that slight loss really doesn't matter.
Seven files, one question each time: does the exact original have to come back? Pick first, then read why.
Predict, then check
A text file is compressed losslessly, sent to a friend, then decompressed. Lock in your guess first.
What does your friend end up with after decompressing it?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
What you need to know
- Compression cuts the number of bits needed to represent a file, by removing unnecessary data or rearranging information more efficiently.
- Here's the catch: a compressed file has to be decompressed before you can use it again.
- Lossless compression makes a file smaller without losing any data. Nothing is permanently removed.
- So it's fully reversible: decompress it and you get exactly the original back, quality and exact detail included.
Have a goSam compresses his essay losslessly, then groans: 'Great, now some of my best sentences are probably gone.' Should Sam panic?
No. When he decompresses it, every word comes back exactly.
Sam is assuming smaller means something was deleted, but lossless permanently removes nothing, so the round trip is fully reversible.
- Text files need lossless, because every character must be preserved exactly for the file to stay correct and usable.
Have a goImagine a compressor turned 'Meet at 5' into 'Meet at 6' in a text file. Just one character. Would that be acceptable?
No. One wrong character and the message is wrong.
It's tempting to call one character a tiny loss, but text is only correct and usable if every character is preserved exactly.
- PNG is a lossless image format, used where the highest quality must be kept, and it supports transparent pixels.
- ZIP squeezes several files into one file, and unpacking it gives back the originals exactly as they were.
Have a goYou ZIP three files into one and your friend unpacks it. How many files do they end up with, and how do they compare with yours?
Three files, each exactly as it was before zipping.
Bundling into one file isn't permanent merging: unpacking a ZIP gives back the originals exactly, because it's lossless.
- Lossy generally gives a smaller file than lossless, but it removes data and may reduce quality.
- Pick lossless when the file must be perfectly preserved, and lossy when a slight quality loss is fine for a smaller file.
Have a goDev announces: 'Lossy always wins because it gives a smaller file, so I use it for everything.' When is Dev wrong?
Whenever the file must be perfectly preserved, like a text file.
A smaller file is only worth it when a slight loss of quality is acceptable; lossy removes data, so it fails any file that must come back exactly.
- The choice comes down to the accuracy needed, the quality needed and the storage limits.
The big picture
Compression cuts the number of bits needed to represent a file, and a compressed file has to be decompressed before you can use it again. Lossless compression makes a file smaller without losing any data, so decompressing gives back exactly the original. That matters whenever a file must be perfectly preserved, like a text file. PNG and ZIP are lossless examples. Lossy generally gives a smaller file but removes data and may reduce quality, so the choice depends on the accuracy needed, the quality needed and the storage limits.
Key points
Worked example
Problem
Maya has a text file of her coding notes and wants it smaller to save space on a memory stick. Should she use lossy or lossless compression, and what must she do before she can read the notes again?
⚠ Watch out
Thinking a smaller file always means something was thrown away. That's true for lossy. With lossless, the file gets smaller and no data is permanently removed, so the exact original comes back when you decompress.
Memory hook
Loss-less: zero loss, not a little less. Compress it, send it, decompress it, and every bit is back in its seat.
Check yourself
A friend insists: 'If a file got smaller, some of it was deleted.' Explain why that isn't always true, and name one kind of file that needs lossless compression.
Flashcards
(11)What does data compression do?
What has to happen to a compressed file before you can use it again?
What is lossless compression?
Why is lossless compression called fully reversible?
Which kinds of file need lossless compression?
What is PNG good for?
What does ZIP do?
Lossy or lossless: which generally gives the smaller file?
What does lossy compression do to the data and the quality?
Name the three things the choice of method depends on.
When would you choose lossy instead of lossless?
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 postedMore Edexcel GCSE Computer Science topics
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 26 October 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.