In computing, 1 KB = 1024 bytes (powers of 2), not 1000
Hard drives often use 1 KB = 1000 bytes — this is why your 500 GB drive shows less in Windows
Lossless vs Lossy Compression
Two Types of Compression
Lossless: no data is lost — file can be perfectly restored. Examples: PNG, ZIP, FLAC. Used for text, programs, medical images.
Lossy: some data is permanently removed — smaller file but quality reduced. Examples: JPEG, MP3, AAC. Used for photos, music, video.
Lossy achieves much higher compression ratios; lossless maintains perfect fidelity
Run-Length Encoding (RLE)
Lossless Compression in Action
RLE replaces repeated consecutive values with a count and the value. Very effective for images with large areas of the same colour (e.g. simple logos, clip art).
Original pixel row: W W W W W B B W W B RLE encoded: 5W 2B 2W 1B
Original: 10 values → Encoded: 8 values (saves 20%) RLE is very effective for large uniform areas
Exam Practice
Have a go at this question
Cambridge IGCSE 0478 style
A doctor needs to compress patient MRI scan images. Explain which type of compression (lossless or lossy) should be used and why.
3 marks
Lossless compression [1] should be used because no data is lost during compression [1] so the original image can be perfectly restored — any loss of detail in a medical image could lead to misdiagnosis [1].
Key Takeaways
What to Remember
Units: bit → byte (8) → KB (1024) → MB → GB → TB
Lossless: no quality loss, perfect restoration (PNG, ZIP, FLAC)
Lossy: some data permanently removed, smaller file (JPEG, MP3)
RLE: lossless method — store count + value for repeated sequences