Unit 1 · Digital Information · Lesson 1.9

Compression II: Lossy

Throwing information away on purpose — and the judgement call about when that's allowed.

Big Idea 2 — Data

Before this lesson

No Runestone reading. The book doesn't cover compression — everything you need is on this page.

1

Where We Are

People→ Bits→ Programs→ Internet→ Security→ Big Data→ Impact

Last new idea in Bits. In 1.8 you proved that lossless compression can't reach 12:1 on a photograph — and then had to admit your phone does it anyway. Today you find out what it cost, and you learn the thing the exam actually asks: not which method is smaller, but which method the situation permits.

2

The Hook

Which one is broken? Below this page you'll find the same image saved five times at five different quality settings. One of them is unmistakably ruined. One or two are fine. The interesting ones are in between.

Your job is not just to spot the broken one. It's to find the smallest one you would still be willing to post — and then to notice that you just made an engineering decision, on behalf of everyone who will ever look at it, using nothing but your own eyes as the standard.

3

The Idea

Lossy compression reduces size by permanently discarding some of the data. Not rearranging it, not encoding it more cleverly — deleting it. Decompress a lossy file and you get something that resembles the original. You never get the original.

Lossless is reversible: compress → decompress → identical.
Lossy is not: compress → decompress → similar. The discarded data is gone permanently.

Which raises the obvious question: how do you delete part of a photo and have it still look like the photo? The answer is that lossy methods are built around human perception. They target the detail people are least likely to miss.

None of that is magic, and none of it is free. Every one of those choices is somebody's model of what a typical person won't notice, applied to everybody.

Ratios worth carrying. On a photograph, lossless formats manage roughly 2:1 — you measured why in 1.8. JPEG at ordinary quality routinely hits 10:1 or 20:1, which is how 36 MB becomes 3 MB. The gap between those two numbers is exactly the size of what got thrown away, and the widget below measures both on the same image so you don't have to take my word for it.

The part that surprises people

In 1.1 you learned that digital copies are perfect — copy number ten thousand is bit-for-bit identical to the original. That is still true. But re-saving is not copying.

Every time a lossy file is decoded and re-encoded, it takes another pass of the same discarding process, on data that has already been through it once. Damage accumulates. Do it enough times and the image visibly falls apart — which is why a meme that has been screenshotted and reposted forty times looks like it was carved out of soup. You can run that experiment yourself in a moment, and watch it happen in about two seconds.

The actual exam skill

Here is what gets tested, and it is not "which one is smaller." It's this:

Given a situation, choose lossless or lossy and justify the choice from the requirements of that situation.

The question to ask is never "how small can this get?" It's "what happens if a detail is wrong?" If a lost detail is an inconvenience, lossy is usually right. If a lost detail could change a diagnosis, break a program, or alter a legal record, lossless is the only defensible answer no matter how much storage it costs.

Never lossy: executable programs and installers (one wrong bit and it won't run), spreadsheets and databases, source code, legal and financial records, and anything that must be reproduced exactly as filed. "Slightly wrong" is not a category these things have.
4

Try It

Find the broken one

The same image, five quality settings. Click any one to see it large. These are real JPEGs, encoded in your browser right now — the byte counts are measured, not made up.

The selected image at the chosen JPEG quality

Now press "Re-save it 25 times." Nothing is being added — the file is just being decoded and re-encoded, over and over, exactly as it would be by repeated screenshotting and reposting. Compare it to 1.1, where copying was perfect and free. Copying still is. Re-encoding never was.

Lossless or lossy?

Ten situations. Pick a method and read the justification — the reasoning is the point, not the label.

0 of 10 answered

Argue the hard one out loud

Two of the scenarios above are genuinely contested — reasonable people pick differently. Find them, then take the side you didn't pick and make the strongest case for it in three sentences.

If you can't argue both sides, you don't understand the tradeoff yet — you've just memorised an answer. On the written responses, the points are in the justification, not the choice.

5

Vocabulary

One new term, and the pair it completes.

lossy compression Bits
A compression technique that reduces size by permanently discarding some data, so the original cannot be reconstructed exactly — only approximated.
lossless compression from 1.8
A compression technique in which no information is lost, so the original data can be reconstructed exactly from the compressed version.
6

Check

Five questions in AP format. Pick an answer to see feedback immediately.

0 of 5 answered
7

Impact Check

Streaming exists because of this, and so does the gap

Raw HD video is roughly 6.2 MB per frame at 30 frames a second — you computed the frame size yourself in 1.5. That is about 186 MB per second, which no home connection on Earth can carry. Video streaming is not difficult without lossy compression; it is impossible. The same is true of video calls, which means remote school, remote medicine, and remote work all rest on deciding what detail humans won't miss.

That's an enormous good. And the mechanism that delivers it hands out different amounts of it to different people. When a connection is slow or metered, the stream drops to a lower quality automatically — more discarded, smaller file, still watchable. So the person on rural or limited internet gets the blurry lecture, the compressed video call, the version where the whiteboard can't quite be read. Not because anyone chose to disadvantage them, but because the fallback that keeps the service working at all is the same fallback that degrades it.

This is the digital divide, and you'll meet it properly in Unit 8. Notice its shape here: the technology is genuinely good, it is not distributed evenly, and the unevenness follows from an ordinary engineering tradeoff rather than from anybody's bad intent. Those are the hardest kind to fix, because there is no villain to remove — only a decision about who the default was tuned for.

8

Connections

Came from 1.5 — the 36 MB cliffhanger is now fully closed. Lossless explained about 2:1; the rest was thrown away on purpose.
Came from 1.6 — sampling already discarded everything between the measurements. Lossy compression is the same bargain, made a second time and more aggressively.
Came from 1.8 — the counting proof said no method shrinks everything. Lossy sidesteps it by not promising to give the original back.
Returns in Unit 8 — the digital divide, in full. Today was the preview, and you've now seen the mechanism from the inside.
← 1.8 Compression I: Lossless