Every compression technique below is genuinely running on real, visible data, watch a grid actually shrink into runs, a dictionary actually grow entry by entry, and an image actually lose real, measurable detail as compression gets more aggressive.
RLE replaces a run of identical values with just the value and a count. Try a pattern with long runs, then try one without, and watch what actually happens to the size.
Rather than counting runs, build a dictionary of substrings seen so far, and replace repeated substrings with a short reference into it. Watch the dictionary actually grow, and the output actually shrink, symbol by symbol.
| Code | Entry |
|---|
Reduce the number of distinct brightness levels an image is allowed to use. Watch the actual picture degrade, and see exactly how many pixels changed value, this is lossy compression in the most literal sense: information that cannot be recovered.