Run-length encoding
Huffman coding
Dictionary (LZ)
Lossy vs lossless
Practice
What is being encoded
A 1-bit bitmap
A line of text
All ones
Bands
Two halves
A diamond
Checkerboard
The line of characters to encode
Width of the count field
4
the run ribbon under the data
compare with Huffman on the same data
Message
…or type your own (24 characters, at most 8 different symbols)
the 0 and 1 on every branch
Scheme
LZ78 — build a dictionary
LZ77 — point back into the text
Text
Search window
32
…or type your own (up to 44 characters)
The picture
A soft blob
A smooth ramp
A flat-colour icon
Random noise
Bits kept per pixel
3
the error map — what was thrown away
the data, the encoder and the size it ends up
click a pixel to flip it
1
—
Check
Hint
Start again
←
→
How to think about it
Common mistakes