Faster Transfer
Smaller files transfer more quickly over a network — important for streaming, email attachments, and web content.
Less Storage Space
Compressed files take up less space on disk or in the cloud — more content fits on the same device.
Common formats:
Common formats:
| Factor | Lossy | Lossless |
|---|---|---|
| File size reduction | Large reduction | Moderate reduction |
| Quality | Reduced permanently | No change |
| Data recovery | Impossible | Full recovery possible |
| Best for | Media (audio, video, photos) | Text, code, archives |
RLE is a simple lossless compression method. Consecutive repeated values are replaced with a count and the value — a "run".
Original data:
A A A B B B B A
RLE encoded:
3A 4B 1A
Original
8 characters
Compressed
6 values
Saving
25%
RLE works well when:
RLE works poorly when:
Type a string of repeated characters (uppercase, e.g. AAABBCCCC) and click Encode to see the RLE output.
Original:
RLE Encoded:
Original length
—
Encoded length
—
Space saved
—
Click each card to classify it as Lossy or Lossless. Then click "Check Answers" to see your score.
Compression that permanently removes data. Smaller files but reduced quality.
Compression that retains all data. Original file can be perfectly restored.
Run-Length Encoding. Replaces repeated values with a count + value pair. Lossless.
Visual or audio distortion caused by lossy compression (e.g. blurry JPEG edges).
For audio/video: number of bits per second. Lower bit rate = more lossy compression.
A compressed file (e.g. ZIP) containing one or more files. Usually lossless.
1. A photograph is compressed using lossy compression before being posted on social media. State one advantage and one disadvantage of using lossy compression for this image. [2 marks]
One mark each. Keep each answer to one clear statement.
Mark scheme:
Advantage — award 1 mark for any one of:
Disadvantage — award 1 mark for:
2. Explain the difference between lossy and lossless compression. [4 marks]
Two points about each type needed. Each point must include a cause and consequence.
Mark scheme:
Lossy:
Lossless:
Award marks for comparative statements too, e.g. "lossy files are smaller than lossless" — must be clear which is which.
3. A string of data is: AAAAABBBCCA. Use run-length encoding to compress this string. [2 marks]
Write your answer as count-value pairs (e.g. 3A4B...).
Mark scheme:
5A 3B 2C 1A
Accept notation like (5,A)(3,B)(2,C)(1,A) or written as "5 As, 3 Bs, 2 Cs, 1 A".
Exam Technique Reminders