OCR Computer Science J277 - Mr Brown
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:
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
These mix a few styles β sorting scenarios, true/false, advantage-or-disadvantage, and quick-fire questions.
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.
Permanently removes some data β usually detail humans barely notice. Once removed, it cannot be recovered.
| Advantages | Disadvantages |
|---|---|
| Much greater size reduction | Quality/data permanently lost |
| Faster to transmit/stream | Cannot restore the exact original |
| Saves more storage | Repeated compression worsens quality further |
Typical uses: streaming, JPEG photos, MP3 audio.
Removes redundant data only β reversible, so the original can always be rebuilt exactly.
| Advantages | Disadvantages |
|---|---|
| No data or quality lost | Can't shrink files as much as lossy |
| File always perfectly restored | Larger result than a lossy version |
Typical uses: documents, program files, spreadsheets, ZIP archives, PNG images, legal/medical records.
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.