LightMySky

Compression: Lossy and Lossless

Making a file smaller either by storing the same information in fewer bits, or by dropping detail people are unlikely to miss. Which of the two is safe depends on the file.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Describe a lossless method, such as recording runs of repeated values
  • Explain what lossy compression throws away and why it cannot be put back
  • Choose the right kind for a photo, a song and a file of code

1 · Read

Compression shrinks files so more fit and less travels. Lossless packing keeps every bit, so ZIP files and PNG images round-trip perfectly. Lossy packing drops fine detail for tiny files, and dropped detail never comes back.

Try it together

Run-length encoding condenses repeats by counting runs, always starting with the whites. The row 0001100000110000 becomes 3, 2, 5, 2 and 4. A row opening with red starts with 0, like 0, 15 and 1.

Lossy leans on your senses. A cat photo at half size still reads fine, since eyes forgive averaged colour. A drum beat masks nearby sound for 20 ms before and 200 ms after, so hidden audio can go. But re-saving lossy copies each edit grinds quality down, so keep masters lossless.

Good to know

Match the kind to the file. Photos and songs survive trimming, while text, code and spreadsheets need every bit back.

Pack repeats to keep every bit, or trim hidden detail for tiny files, and keep lossless for files that must return whole.

2 · Watch

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Compression: Lossy and Lossless · Computing, ages 15 to 16 · LightMySky