Lossy vs Lossless: How Image Compression Actually Works
Every image you see online has been compressed, usually to a tenth of its raw size or less, and mostly you cannot tell. That near-magic rests on one insight: human eyes are precise about some things and astonishingly careless about others. Compression is the art of throwing away exactly what you were never going to notice.
Two philosophies: exact or convincing
Lossless compression (PNG, and WebP's lossless mode) is repackaging: it finds repetition and encodes it tighter, like writing '87 blue pixels' instead of listing them. Decompression restores every pixel bit-for-bit. The size win is real but bounded; typically 30-70% on graphics, almost nothing on photographic noise.
Lossy compression (JPG, WebP) makes a different promise: not the same image, but one your eyes accept as the same. By discarding information selectively it reaches 90-95% savings on photographs. The discarded detail is gone permanently; no tool recovers it, whatever a crime show implies.
What lossy compression actually throws away
First casualty: color precision. Eyes resolve brightness far more finely than color, so JPEG stores color at half or quarter resolution (chroma subsampling) before doing anything else. On photos this is invisible; on red text over blue it produces fuzzy edges, one reason screenshots hate JPG.
Second casualty: fine, low-contrast texture. The image is cut into 8×8 blocks and each block is described as waves (a DCT); the subtle, high-frequency waves get rounded off hardest. Skin stays smooth-looking long after the pore texture is gone, which is precisely the bet the format makes.
Artifacts are what rounding looks like when it goes too far: blockiness in smooth skies where neighboring 8×8 blocks disagree, and mosquito noise (shimmering halos) around sharp edges the wave-description cannot express cleanly. Once you learn both, you will see them in every over-compressed meme.
Reading the quality slider like an engineer
The 0-100 quality number controls how aggressively waves get rounded, and its effect is sharply nonlinear. From 100 down to about 85, files shrink dramatically while visible change stays near zero; this range is where the free money is. 75-85 remains excellent for web use; below about 60 artifacts step out of hiding; below 40 the image is visibly damaged.
The number is also not comparable across tools or formats: one encoder's 80 is another's 70, and WebP at 75 typically matches JPG at 85. Trust your eyes at 100% zoom on the worst spot (sharpest edge, smoothest gradient) rather than the number itself.
Sequential saving deserves its warning here too: each lossy save rounds the previous rounding. Ten casual re-saves can do more damage than one save at low quality. Edit from originals; compress once, at the end.
A decision routine that always lands
Ask what the pixels are for. A photo going into a chat or website: lossy at quality 75-85, and try WebP first. A screenshot, diagram or anything with text: lossless, where 'compression' costs nothing visible. A photo being archived: keep the original file untouched; storage is cheaper than regret.
When a file must hit a size limit (a 2 MB upload form, an email cap), reduce DIMENSIONS before reducing quality: a photo scaled to 70% size at quality 85 nearly always beats the full-size photo strangled to quality 50, because fewer pixels shrink the file honestly while heavy rounding shrinks it destructively.
Try the tool:
Compress Image