Learn why and how we compress files, understand lossy vs lossless compression, and practice RLE and dictionary encoding.
Understanding why and how we compress data
Store more files on your device. E.g., compress music to fit more songs on your phone.
Reduce transmission time over networks. E.g., upload images faster to social media.
| File Type | Recommended | Reason |
|---|---|---|
| Text files | Lossless | Every character matters |
| Executable files | Lossless | Code must be exact or program won't work |
| Documents | Lossless | Data integrity is essential |
| Photos | Lossy (usually) | Human eye won't notice small changes |
| Music | Lossy (usually) | Human ear won't notice removed frequencies |
| Video | Lossy | Huge files need significant compression |
Create pixel art and see how RLE compresses it
Click cells to paint them. Watch how Run Length Encoding compresses each row by counting consecutive colours.
See how repeated words are replaced with shorter codes
Enter text below to see how dictionary encoding compresses it by replacing repeated words.
Match compression concepts with their descriptions
Match each compression term with its correct description.
Sort file types and characteristics into Lossy or Lossless
Test your understanding with these exam-style questions