Lossless vs Lossy: How PDF Compression Actually Works
Two people click the same compress button. One watches a 40MB file collapse to 3MB; the other saves four percent and wonders what went wrong. Nothing went wrong — they fed the button different documents, and under the hood two entirely different technologies decide which story you get.
The first technology is lossless compression: clever bookkeeping that stores the same information in fewer bytes, the way 'AAAAAAA' can be written '7×A'. PDFs apply it (usually the Flate algorithm, zip's cousin) to text, fonts, and structure — and a good optimizer also rebuilds the file's plumbing: dropping duplicated resources, dead objects, and leftovers from old edits. Lossless work is perfectly reversible and visually invisible; on a bloated, badly-generated file it can be dramatic, but on a well-made one it trims single-digit percentages, because there is only so much bookkeeping to improve.
The second technology is lossy compression, and it is where the 90% savings live. Lossy means deliberately discarding information: resampling a 4000-pixel-wide photograph down to the 1600 pixels a reader will actually see, then re-encoding it as JPEG, which further drops fine detail the eye ignores. The discarded pixels are gone forever — recompressing an already-compressed image can only degrade further, which is why archiving originals matters and why the second pass through any compressor saves so much less than the first.
Now the two stories explain themselves. The 40MB-to-3MB file was full of oversized images — lossy resampling feasted on it. The four-percent file was already text-plus-lean-graphics: only lossless bookkeeping applied, and there was little fat to find. It also explains a subtler failure you may have met elsewhere: some tools achieve big numbers by rasterizing entire pages — converting your text into one big photo. The file shrinks; the selectable, searchable, razor-sharp text dies with it.
PdfWill's compress tool combines the honest halves of both worlds: images inside the document are resampled and re-encoded (lossy, with 'Recommended' and 'Strong' choosing the aggressiveness), text and vector art pass through untouched, and a final lossless pass rebuilds the structure. And if the result somehow isn't smaller than the original, you get the original back — because a compression that makes files bigger is bookkeeping in the wrong direction.