nothing is gone.
only the air between.
image: ai-generated (gpt-image-2)

compression as a box, twice

two boxes, input, processing, output. what goes into the first must come out of the second.

why anything compresses at all

the usual way of writing things down wastes room. that room is the first kind of air.

a second kind of air: some letters come far more often

a fixed code pays the same bits for the e and for the z. that difference is air too.
letter frequencies: lewand, cryptological mathematics, 2000
the word for both: redundancy
fewer bits for what surprises less
a stretch seen before: cheaper to name than to spell again (contextual)
a frequent letter: less surprise, so a shorter code (alphabetic)
random characters: full surprise every time, nothing to save
information, as in symbols and information: a measure of surprise
bits go to surprise. the rest is redundancy, and it can go.

trick one: point back

say it once. then say where it was.

trick one: what it looks like in the file

a pointer is three bytes here: a marker, how far back, how long. 49 bytes become 41.

trick one on a picture: run length

the bigger the areas, the more it saves.

trick one: run length, the bad case

every method makes some files bigger. yours too.

trick two: the frequent letter gets the short code

both halves are known: codes of different length, the frequent one short. now the recipe.

trick two: count first

the same code for every letter: the a pays as much as the d.

trick two: build the tree

always join the two rarest. that is the whole algorithm.
huffman, 1952

trick two: read the codes off the tree

23 bits instead of 33. nothing lost.

trick two: why it reads itself

no code is the start of another. the prefix trap from code systems, avoided by construction.

try it: squeeze your own text

and that is a zip

every zip you ever opened did these two tricks. nothing else.
measured with python's zipfile, level 9, 13 sept 2026

why the random bytes could not shrink

no method shrinks everything. counting says so.

how much redundancy a picture has

one colourpng · 569 bytes
the parrotpng · 93 107 bytes
random noisepng · 197 172 bytes
all three are 196 608 bytes raw. lossless packing takes the parrot to half; the noise it cannot touch.
real files, 256 × 256 points, sizes as measured · parrot: ai-generated (gpt-image-2)

what png does before it packs

predict each point from its neighbour, keep only the surprise. then deflate.

the parrot, honestly

lossless gets you to half. lossy gets you to a twentieth, and it is not the same picture.

the same parrot, four times

png · 93 107 byteslossless
jpg · 10 587 bytesquality 75
jpg · 3 081 bytesquality 10
jpg · 2 032 bytes128 × 128 points, quality 25
still a parrot. and now it fits.
real files, sizes as measured · image: ai-generated (gpt-image-2)

what the eye and the ear do not notice

lossy means: a model of the senses decides what may go. not a worse packer, a different bargain.
images: ai-generated (gpt-image-2)
a one-way street
lossless: unpack, and you hold the original
lossy: unpack, and you hold something that looks like it
from the 2 kb parrot, the 93 kb never come back.
lossless or lossy
must exactly this file arrive? then lossy is out.
must a presentable picture arrive? then it is your strongest lever.
the task decides, not the tool. and ask before you spend an hour optimising.
the receiver has to know
which method
which settings
written into the specification, next to preamble and character code
packed data does not explain itself.

today

1 zip three files of your own and explain the three ratios
2 bring the parrot under 2 kb, and write down what you gave up
3 put method and settings into your specification
two kilobytes.
still a parrot.
photo: parrot, 128 × 128 points, 2 032 bytes, shown point for point · image: ai-generated (gpt-image-2)