How to Compress Images Without Losing Quality
Published 2026-07-15
Shrinking a file always means throwing away some data. The trick is throwing away data you won't notice, which comes down to three settings: quality, resolution, and format.
Why "quality" and "file size" are a trade-off
Every photo is a grid of pixels, and each pixel needs data to describe its color. A raw, uncompressed image would be enormous, so image formats use compression to throw away or approximate some of that data. JPEG, the most common photo format, uses lossy compression: it deliberately discards detail a human eye is unlikely to notice, in exchange for a much smaller file. The more aggressively you compress, the more detail gets discarded, and eventually that shows up as blurriness or blocky artifacts, especially around sharp edges and text.
The three levers that actually matter
Most of the visible quality loss in a compressed image comes down to three settings, and understanding them is more useful than blindly dragging a quality slider down until the file is small enough.
Quality percentage. This directly controls how much detail JPEG or WebP throws away per block of pixels. Above roughly 80%, quality loss is nearly invisible to the naked eye on most photos. Between 60 and 80%, you'll see mild softening if you look closely. Below 50%, blockiness and color banding start becoming obvious, especially in skies, skin tones, and other smooth gradients.
Resolution. A photo that's larger than it needs to be for its final use (say, a 4000-pixel-wide photo displayed at 800 pixels wide on a webpage) is wasting file size on detail nobody will ever see. Downscaling to the actual display size, before compressing, almost always beats compressing an oversized image harder. This is why a good compressor will offer to resize as well as compress.
Format. PNG is lossless and excels at flat colors, screenshots, and graphics with sharp edges, but it's a poor choice for photos, where it produces much larger files than JPEG or WebP for the same visual result. WebP typically beats JPEG at an equivalent visual quality by 25 to 35%, making it the best default for photos when you don't need maximum compatibility with very old software.
A practical approach
If you have a specific file size target, like a 200 KB limit for a job application upload or a 2 MB limit for an email attachment, the most reliable method is to compress toward that exact target rather than guessing at a quality percentage. A tool that lets you type in a target size and automatically finds the right quality (and resizes if needed) removes the trial-and-error entirely.
If you don't have a hard size limit, a good default is: keep the resolution at whatever size the image will actually be displayed, use WebP if your destination supports it, and start at 80% quality, only dropping lower if the file is still too large.
What about PNG screenshots and logos?
For anything with flat colors, transparency, or crisp text, like a screenshot, a logo, or an icon, PNG's lossless compression is still the right call, it just doesn't compress nearly as efficiently as JPEG or WebP for photographic content. If a PNG screenshot is too large, the most effective fix is usually cropping out unnecessary parts of the image or reducing the color palette, rather than trying to force it into a lossy format that will visibly degrade the sharp edges of text and UI elements.