Compression is essential in modern computing - without it, storing and transmitting large files like videos, images, and documents would be impractical. There are two fundamentally different approaches to compression, each with specific use cases.
Lossy Compression
Lossy compression achieves dramatic file size reductions by permanently removing data - specifically, the parts that are least noticeable to human perception. Once compressed, the original data cannot be fully recovered.
• Analyses data to identify less important information
• Removes data that humans are less likely to notice
• JPEG removes colour variations the eye can't distinguish
• MP3 removes frequencies outside normal hearing range
• The more compression, the more quality loss
Original photo: 10 MB
High quality JPEG (90%): 2 MB - minimal visible difference
Medium quality JPEG (50%): 500 KB - some blur/artifacts visible
Low quality JPEG (10%): 100 KB - significant quality loss, blocky artifacts
MP3 Audio Compression:
Original WAV: 50 MB
320 kbps MP3: 10 MB - near-CD quality
128 kbps MP3: 4 MB - acceptable quality for most listeners
64 kbps MP3: 2 MB - noticeable quality loss
Lossless Compression
Lossless compression reduces file size without losing any data - the original can be perfectly reconstructed. This is achieved by finding and encoding patterns in the data more efficiently.
• Identifies patterns and redundancy in data
• Encodes repeated patterns with shorter representations
• No information is discarded
• Decompression perfectly restores original
• Compression ratio depends on data patterns
A folder of text documents might compress from 100 MB to 20 MB (80% reduction) because text has many repeating patterns.
A folder of already-compressed JPEGs might only go from 100 MB to 98 MB (2% reduction) because there's little redundancy left to exploit.
Comparison
• Lossy: Yes - permanently
• Lossless: No - perfect reconstruction
Compression Ratio
• Lossy: High (often 90%+)
• Lossless: Lower (typically 50-70%)
Best For
• Lossy: Images, audio, video
• Lossless: Text, code, documents, archives
Examples
• Lossy: JPEG, MP3, MPEG, H.264
• Lossless: ZIP, PNG, FLAC, GIF
Quality
• Lossy: Degrades with more compression
• Lossless: Always perfect