πŸ—œοΈ Compression Explorer

OCR Computer Science J277 - Mr Brown

πŸ“¦ Lossless: Run-Length Encoding

Run-length encoding (RLE) is just one example of a lossless method β€” not required for the exam β€” but it shows how repeated data shrinks with nothing lost. Step through it row by row below.

Row 1 of 9

Compressed data so far β€” a run only ends when the colour changes, even across a row boundary:

πŸ“Š Running Totals

Original Size

0 bits

Compressed Size

0 bits

Runs Found

0

Space Saved

0%

πŸ—œοΈ Lossy: Resolution & Colour Depth

Lossy compression can keep fewer pixels (lower resolution) and fewer colours (lower colour depth) than the original β€” both permanently throw detail away.

Resolution

Colour Bit Depth

Original (uncompressed)

After lossy compression

Resolution

160Γ—96

Colour Depth

24-bit

File Size

-

Space Saved

0%

Visual Quality

Perfect

πŸ† Compression Challenges

These mix a few styles β€” sorting scenarios, true/false, advantage-or-disadvantage, and quick-fire questions.

Challenges Complete

0

Total Points

0
Challenge

Loading challenge…

πŸ“š Master Compression

πŸ“¦ The Need for Compression

Compression reduces a file's size, saving storage space and reducing the time/bandwidth needed to send it over a network.

Common scenarios: streaming video/music, email attachments, downloading apps/updates, images on websites, backing up data, video calls.

πŸ—œοΈ Lossy Compression

Permanently removes some data β€” usually detail humans barely notice. Once removed, it cannot be recovered.

AdvantagesDisadvantages
Much greater size reductionQuality/data permanently lost
Faster to transmit/streamCannot restore the exact original
Saves more storageRepeated compression worsens quality further

Typical uses: streaming, JPEG photos, MP3 audio.

πŸ“¦ Lossless Compression

Removes redundant data only β€” reversible, so the original can always be rebuilt exactly.

AdvantagesDisadvantages
No data or quality lostCan't shrink files as much as lossy
File always perfectly restoredLarger result than a lossy version

Typical uses: documents, program files, spreadsheets, ZIP archives, PNG images, legal/medical records.

🎡 The Same Ideas Apply to Sound

Audio compresses using the same two ideas as images. Lossy audio (e.g. MP3) can reduce the sample rate and/or bit depth β€” just like the Lossy tab here β€” and also uses perceptual (psychoacoustic) shaping, which discards sounds humans can barely hear, such as a quiet sound masked by a louder one. Lossless audio (e.g. FLAC) removes repeated/predictable patterns, similar in spirit to RLE, so the exact original sound can be rebuilt.

βœ… What to Remember for the Exam

  • Compression reduces file size to save storage and reduce transmission time/bandwidth.
  • Lossy: permanently discards data β€” big size reduction, reduced quality, can't be fully recovered.
  • Lossless: removes redundancy only β€” file restored perfectly, but size reduction is more limited.
  • Use lossy for casual media (streaming, photos); use lossless for anything that must be exact (text, code, records).
  • You don't need to carry out a specific compression algorithm β€” just the need, the two types, and their effects.