CoursesAIMathCodePhysicsAbout and FAQ

TwiddleLab / Code / How Computers Store Everything

Throw Away What You Won't Notice

Lesson 7 of 11 · 7 min · Free, no account needed

What you will learn

  • Lossy compression throws away detail you are unlikely to notice, forever.
  • JPEG keeps the broad colour of each 8 x 8 block; MP3 and AAC drop sounds you can't hear.
  • Lossy files are often 10 times smaller. Use lossless where every bit matters: code, documents, medical scans.
  • Saving a lossy file again loses a little more each time.

Start the lesson

How the lesson goes

  1. Why does a meme look worse every time it gets reposted?

    Repost it a few times.

  2. Squeeze the meme as JPEG.

    Find a quality where the file is at least 20 times smaller than raw and still looks fine.

  3. One of these is many times smaller. Which is the original?

    Look closely, then tap.

  4. Lossy and lossless.

    Lossy compression throws detail away for good, choosing what people are least likely to notice.

    JPEG splits a photo into 8 x 8 blocks and keeps mostly their broad colours. MP3 and AAC drop sounds hidden by louder ones.

    Lossless (ZIP, PNG, FLAC) gives back every bit, but squeezes much less.

  5. Be the JPEG: fit the picture into 45% of its size.

    Tap a block to fill it with one average colour. Keep the likeness at 90% or more.

  6. Which formats throw information away?

    Drag each file into a jar.

  7. Put a 3 minute song on the right shelf.

    Under 5 MB, and most people can't hear the loss.

  8. A 4 MB photo became a 400 KB JPEG. What percent of the size was saved?

    1 MB = 1000 KB.

  9. Lossy or lossless? Tag each case.

    Ask: would a lost detail hurt?

  10. What happens if your JPEG is saved again and again?

    Run the resaves and watch the loss counter.

Previous lesson: Squeezing Without Losing · Next lesson: The Parity Magic Trick · Part of the course: How Computers Store Everything

Lessons are interactive and need JavaScript. Turn it on to play them.

Loading TwiddleLab