ShrinkTo

Compress images without losing quality: how it actually works

MozJPEG, pngquant, WebP and AVIF explained - why modern codecs shrink files dramatically with no visible difference.

"Compress without losing quality" sounds like marketing, but modern codecs genuinely get you most of the way there. The trick is that a lot of the data in a typical image file is imperceptible to the human eye - and good encoders know exactly what to throw away.

MozJPEG: smarter JPEG encoding

MozJPEG re-tunes the classic JPEG format with better quantization and trellis optimization. The result is the same JPEG any device can open, but 10-30% smaller at the same visual quality.

pngquant: lossy PNG that looks lossless

PNG is lossless by default, which makes it large. Palette quantization (the technique behind pngquant and libimagequant) reduces the number of colors intelligently, often cutting size by 60-70% with no difference you can see - this is what TinyPNG is famous for.

WebP and AVIF: the modern formats

  • WebP is typically 25-35% smaller than JPEG at equivalent quality and is supported everywhere today.
  • AVIF goes further still - often half the size of JPEG - at the cost of slower encoding.
  • Both support transparency, so they can replace PNG too.

Which should you use?

For maximum compatibility, MozJPEG. For the web, WebP is the sweet spot. For the absolute smallest files where you control the audience, AVIF. ShrinkTo lets you output any of them and even suggests the format that hits your target with the best quality.

Tools mentioned

Dakshesh B

Frontend web engineer building fast, accessible, privacy-first tools with React and Next.js. Portfolio.