Tinker Compression

by Samy (Kondasamy Jayaraman) · drawn with Colorfigures by April Zhu

Kestrel␣K2␣handheld␣scanner↵Kestrel␣K3␣handheld␣scanner

Two scanner names from the price list.691 B of 691 B

Chapter 2 of 7

Point back

The price list repeats itself: both scanner rows spell out the same words. What if the second copy just pointed back at the first?

This chapter: How does pointing back at earlier bytes make a file smaller?

About this chapter

You will learn

  • A pointer says: go back this far, copy this many
  • Long repeats shrink most
  • Unpacking copies the bytes back exactly

Words you’ll meet

Pointer
Go back this many bytes and copy this many: it stands in for a repeat.
Literal
A byte written out as it is, because no repeat covers it.
LZ77
Ziv and Lempel’s 1977 method: replace each repeat with a pointer to an earlier copy.

Step 1 of 4

replaces a repeat with a : go back this far, copy this many. The strip holds two scanner names.

Predict how many pointers.

How many pointers will stand in for the repeats in the two names?