Students raise the tolerance of a lossy run-length compressor on a grey picture to see that lossy compression stores far fewer numbers but permanently changes data, and decide where lossy and lossless each belong (AC9TDI10K03 node 3).
Load these into Waypoints Prepare: choose Load URL and paste the copied address, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
SlidesDownload Present from the browser, or export to PowerPoint or PDF.
WorksheetDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can explain the difference between lossy and lossless compression.
I can choose lossy or lossless for a purpose and justify it.
I can name a consequence of using lossy compression in the wrong place.
Timing
Predict and Try 6 min · Worked example 12 min · Vary 12 min · Practise and Make 15 min
Before class
Try the Try and Make boards yourself.
The one idea: lossless gives back exactly the original; lossy discards information permanently to save more space; choose by purpose. Kit contexts for width: medical images and legal evidence (lossless), music streaming and photos online (lossy).
Simplification: real lossy formats (JPEG, MP3) don't merge nearby shades in runs; they use smarter maths to throw away what people perceive least. The board shows the same trade-off in a form students can see.
Running the lesson
Predict: students who chose "yes" hold Sam's misconception; return to them after the Try.
Try: ask which parts of the picture changed first, and why.
Worked example: ask what a doctor or a court would say about the 16 changed pixels.
Vary: debate the "worth it" question in pairs before checking.
Make: compare: why is 27 the edge for this picture?
The hard part (on purpose)
Students believe lost detail can be recovered because the board can slide back to 0. Point out that the board keeps the original; a saved lossy file does not.
When students get stuck
What you will see
A question to ask
The fix
A student says the detail comes back when you open the file (Sam's mistake).
Where would the original shades be stored?
Nowhere: they were thrown away.
A student thinks lossy is always bad.
How long would a song take to stream at ten times the size?
Lossy is a trade-off that suits many purposes.
Answers to the checks
does it come back?: A grey photo is compressed by treating nearly equal shades as the same, so the runs get longer. Then it is opened again. Is it exactly the same as the original? No. Shades that were treated as the same are stored as one shade, and the original values were never saved, so nothing can put them back.
Try: raise the tolerance: Raise the tolerance to 40 or more. How many numbers are stored now, and how many pixels came back different?
At tolerance 40, 16 numbers instead of 28, but 16 of the 48 pixels came back a different shade. Compare with the original on the right.
The trade-off: What makes compression **lossless**? Decompressing gives back exactly the original data Lossless means exact recovery. Lossy means some data is permanently discarded.
Find the mistake: Sam explains what happens to a lossy photo. Click the line where it first goes wrong. line 3 Line 3: the lost detail was never stored, so nothing can put it back. A lossy photo looks close to the original but is not the same.
Which must be lossless?: Which of these must be stored **lossless**? A medical X-ray a doctor will use to find a fracture A change in a few pixels could hide or invent a detail a doctor relies on. Medical images, legal evidence, text and spreadsheets need every value exact.
Back to lossless: Set the tolerance to 0. How many pixels come back different?
None: at tolerance 0 only exact runs are merged. Lossless, 28 numbers.
All the way: Push the tolerance to 128, the most. How many numbers now? Does it still look like the picture?
12 numbers: one run for most rows. The rows are still lighter at the top and darker at the bottom, but the detail inside each row is gone.
Worth it?: From tolerance 40 to 128, the numbers stored drop from 16 to 12 but 20 pixels change instead of 16. Is the extra squeeze worth it? It depends on what the picture is for Compression is a trade-off between size and quality, chosen for the purpose.
Streaming: A streaming service sends music in a lossy format. Why is that a good choice? It is much smaller, so it plays without waiting, and most listeners can't hear what is lost Lossy formats like MP3 throw away sounds people hear least, making files about a tenth of the size.
Formats: Which format is **lossless**? PNG PNG (and ZIP) keep every value; JPEG and MP3 are lossy.
Evidence: A police photo of a number plate is saved as a heavily compressed lossy file. What could go wrong? Letters could blur into each other, so the evidence is unclear or misread Evidence needs every detail; lossy compression can change exactly the details that matter.
Save again: You open a JPEG, edit it and save it as a JPEG again, many times. What happens? It loses a little more detail each time Lossy losses add up. Keep a lossless original and make lossy copies from it.
Review: run-length codes: Review: what is the run-length code for white, white, white, white, black, black, black, black? 4, 4 4 white, 4 black.
the edge of lossless: Find the largest tolerance that still gives back every pixel exactly.
Neighbouring shades in this picture are 28 or 29 apart, so up to 27 nothing merges that shouldn't: lossless. At 28, the first shades merge and the compression becomes lossy.
Solutions
One possible solution for each task. Other correct programs are fine.
Vary: one setting at a time › Back to lossless
Open task: any program that does what the step asks.
Vary: one setting at a time › All the way
Open task: any program that does what the step asks.
Vary: one setting at a time › Worth it?
Open task: any program that does what the step asks.
Vary: one setting at a time › Streaming
Open task: any program that does what the step asks.
the edge of lossless
Open task: any program that does what the step asks.
Stretch and support
Stretch: Save a photo as JPEG at quality 100 and quality 10 and compare the sizes and what changed. Which details went first?
Support: Give the two definitions on a card: lossless = exact recovery; lossy = permanent loss for a smaller file.
Exit ticket
Give one context that needs lossless compression and one where lossy is fine, with a reason for each.
Lossless: a medical scan or spreadsheet, where every value matters. Lossy: streamed music or a shared photo, where a much smaller file matters more than tiny changes.
What each step is for
does it come back?: Committing to whether the picture comes back exactly tests the new move: lossy compression permanently discards information.
Try: raise the tolerance: Raising the tolerance settles the prediction: fewer numbers are stored, and some pixels come back a different shade.
Worked example: lossless versus lossy: Comparing tolerance 0 with 28 and 40 models the trade-off: fewer numbers, more pixels changed, for good. Sam thinks lost detail is restored, the misconception planted after the method; the context question asks where lossy must not be used.
Vary: one setting at a time: Each task changes the tolerance: back to lossless, all the way up, then reading the trade-off, then choosing for a context.
choose a format: Naming lossy and lossless formats, consequences of lossy in the wrong context, saving a lossy file again, and a review of run-length codes.
the edge of lossless: Finding the largest tolerance that still gives back every pixel reverses the process: students find exactly where lossless ends for this picture.
Where it leads
Builds on: Run-length encoding. Where it leads: file formats and codecs (MP3 vs WAV, JPEG vs PNG), and the ethics of altered images and evidence.