ByteTips.

Guide

How to Compress Images Without Losing Quality

A phone photo is 3–6 MB. Learn the three levers — format, quality, dimensions — that shrink it by 80% with no visible difference.

October 14, 2026 · 5 min read · Shayan

An uncompressed photo from a modern phone is 3–6 MB. Put three of those on a web page and visitors on a slow connection wait seconds for images alone. Email them and you hit attachment limits. Upload them and your storage bill grows for no reason. Compression fixes all of it, and the surprising part is how much you can shrink an image before anyone notices. The trick is knowing which lever to pull: format, quality, or dimensions — and understanding that 'without losing quality' really means 'without losing visible quality.'

Lossy vs lossless

Every image format is either lossless or lossy. Lossless compression (PNG, WebP lossless) shrinks the file by encoding the same pixels more efficiently — every pixel survives, bit for bit. Lossy compression (JPG, WebP lossy, AVIF) discards information the human eye barely notices: subtle color variations, fine high-frequency detail. Lossy achieves far bigger savings — a JPG can be a tenth the size of the equivalent PNG — at the cost of quality that only shows under close inspection or repeated re-saving. For photos, lossy almost always wins. For screenshots, logos, and text, lossless is usually the right call, because sharp edges suffer visibly under lossy compression.

The three levers

Compression has three controls, and they stack. First, format: the same photo saved as PNG, JPG, WebP, and AVIF can differ by 5x in size. Second, quality: a single slider that trades visible detail for bytes. Third, dimensions: a 4000px-wide photo displayed at 800px carries 25 times the pixels it needs. Most people only touch the quality slider and ignore the other two, which is leaving the biggest wins on the table.

Choosing the right format

Pick the format first; it sets the ceiling on savings:

  • JPG: the universal default for photos. Everywhere accepts it, good compression, no transparency.
  • PNG: lossless, supports transparency. Best for screenshots, diagrams, and logos. Bloated for photos.
  • WebP: modern replacement for both — typically 25–35% smaller than JPG at the same quality, with transparency. Supported everywhere modern.
  • AVIF: the newest format, even smaller than WebP, but slower to encode and still patchy in older tools.

Quality settings that actually work

For JPG and WebP, the sweet spot is quality 70–85. Below 60, blocky artifacts and color banding appear in skies and gradients. Above 90, file size doubles for detail nobody can see. The difference between quality 80 and 95 is often a 2x file with no visible change — that is wasted bandwidth. If you are unsure, export at 80, zoom to 100%, and compare against the original. For photos of people, you can often go to 70 without anyone noticing; for product photos with fine texture, stay closer to 85.

Resize before you compress

Dimensions dominate file size: halving width and height quarters the pixel count. Never serve a 4000px image in an 800px slot. Resize to the largest size it will actually display at, plus a little headroom for retina screens (2x the display size is plenty). Serving responsive images lets the browser pick the right size itself:

<img
  src="photo-800.jpg"
  srcset="photo-800.jpg 800w, photo-1600.jpg 1600w"
  sizes="(max-width: 600px) 100vw, 800px"
  alt="A compressed photo"
/>

This one change — resizing to display size — often saves more than any quality setting.

What not to do

Two mistakes undo good compression. The first is re-compressing JPGs: every save discards more detail, so editing a JPG, saving it, and re-saving it again visibly degrades it. Keep a lossless master copy and export fresh JPGs from it. The second is compressing the wrong format for the job: a PNG screenshot saved as JPG gets fuzzy text, and a photo saved as PNG is enormous for no benefit. Match format to content, compress once, and keep the original.

Try it

Drop any image into the Image Compressor to pick a format, quality, and max dimension and compare before-and-after sizes — everything runs locally in your browser. For a whole folder at once, the Batch Image Converter converts many images to PNG, JPG, or WebP and downloads them as one ZIP. If your photos start as HEIC, see How to Convert HEIC Photos to JPG first.

More guides