Docuboxer
By Sergio Alonzo Piña··7 min read

How to compress images without losing quality

What compression actually throws away, how far you can push file size before anyone notices, and why picking the right format beats tweaking the slider.

"Without losing quality" means two different things, and most people never separate them before hitting compress: truly lossless (the file decodes back bit-for-bit identical, and savings are modest) or lossy but imperceptible (real data gets thrown away, but not data your eye would ever miss — and there the savings are huge). Almost everyone searching this phrase wants the second one. You can compress your image right now entirely in your browser, no upload required, and keep reading while it runs.

Lossless vs. imperceptibly lossy

Lossless compression (PNG, WebP in lossless mode) repacks the same data more efficiently, but decoding it hands you back the exact same pixels you started with. It's mathematically honest, and its ceiling is set by how much redundancy the image actually has — a photo has little, so lossless savings on a photograph typically land around 10-20%.

Lossy compression (JPG, WebP with a quality setting, HEIC) goes further: it deliberately discards information, betting that the human visual system won't miss it. Tuned correctly, that bet pays off almost every time, and savings can exceed 80% versus the lossless original. That's the actual engine behind "compress without losing quality" — it isn't magic, it's choosing which information is safe to drop.

How lossy JPG compression works, roughly

JPG splits an image into 8×8-pixel blocks, transforms each block into a frequency domain (where colors change sharply versus where they're smooth), then quantizes those frequencies: sharp, high-contrast changes — the ones your eye actually notices — are kept with precision, while fine, low-contrast detail gets trimmed or dropped, since it barely registers in a natural photo. JPG also typically reduces color resolution while keeping full brightness resolution, because human vision is far more sensitive to changes in luminance than in raw color.

The trouble starts when quantization gets too aggressive: those 8×8 blocks stop blending into each other and become visible as patches — the classic "blocky" look of an over-compressed JPG — and sharp edges pick up color fringing and halos, because the high-frequency detail that defined that crisp edge is gone. Blockiness and haloing are the two tells that you've crossed from "imperceptible" into "visible."

The sweet spot: quality around 80

In most JPG and WebP encoders, the savings curve isn't linear. Dropping quality from 100 to 90 barely moves file size; dropping from 90 to 80 can cut it in half with almost no visible change. Past 80 and heading lower, every additional point saves proportionally less weight while visible degradation accelerates. That's why quality ~80 is the standard starting point — the file is already a fraction of the original and the eye still can't tell. From there, nudge up or down depending on how much fine detail the photo has and what it's going to be used for.

The most expensive mistake: skipping the resize

Before you touch a quality slider, one question saves more file size than any compression setting: what size will this image actually display at? Serving a 4000-pixel-wide photo — the default output of practically any modern phone camera — into an 800-pixel slot means the browser downloads and throws away 96% of those pixels. That's by far the most common and most expensive mistake in web images: compressing an oversized image instead of resizing it first. The image resizer lets you match dimensions to the actual display size, and compressing that correctly-sized file afterward beats cranking down quality on the original every time. If you also need to fix the framing before resizing, the image cropper handles that step.

Generation loss: what happens when you re-save a JPG repeatedly

Every time you open a JPG, make a small edit, and save it again as a JPG, the lossy encoder re-runs its entire quantization process — on an image that already lost information in the previous save. Rounding errors compound across generations: a photo re-saved ten times looks worse than the same photo compressed once at a lower quality setting. The fix is simple — always keep and edit from the original (or a lossless copy), and export to compressed JPG only once, as the final step.

When the answer is a different format, not a lower slider

The quality slider isn't the only lever, and sometimes it's the wrong one. For photographs, WebP typically delivers better quality than JPG at the same file size. For screenshots, logos, or graphics with text and flat color areas, PNG preserves sharp edges that JPG smudges with artifacts — the problem there isn't quality, it's the wrong format entirely. And if the source is vector art (a logo, an icon), don't rasterize it at all: keep it as SVG, or use the SVG converter to move between vector and raster as needed. To switch between JPG, PNG, and WebP without touching size or quality, there's the image format converter.

Why this actually matters: LCP and Core Web Vitals

On most web pages, the largest visible image on load is the element that determines Largest Contentful Paint (LCP), one of the core Core Web Vitals metrics. An oversized, poorly compressed image directly delays that score, with a real effect on how Google evaluates the page's experience. Resizing to the actual display size, choosing the right format, and compressing at a sensible quality isn't just about file size — it's usually the single highest-leverage performance fix on a typical site.

Being honest about the tradeoff

There's no setting that removes weight for free. What exists is picking the right cutoff for where the image is going: a catalog thumbnail can take aggressive compression because nobody is going to zoom into it; a full-bleed hero photo deserves a more conservative setting; and for archival or print work, lossy compression usually isn't the right call at all. Docuboxer's compressor runs entirely in your browser — nothing gets uploaded — so you can try different quality levels on personal or client photos without any of it leaving your machine.

Frequently asked questions

How much can I compress a photo before it looks bad?

For a typical photo, a JPG quality setting around 75-80 usually cuts file size to a fraction of the original with no visible difference. Below roughly 60, blocky patches start showing up in flat-color areas and color fringing appears around sharp edges. The exact threshold depends on the image — a busy, detailed photo tolerates more aggressive compression than a smooth gradient or a plain background.

Does compressing an image always reduce quality?

Not if you mean lossless compression (PNG, WebP lossless): the file decodes back to the exact same pixels, though the savings are modest. Lossy compression (JPG, WebP with a quality setting) does permanently discard information, but when that discard is tuned well, the loss is invisible to the eye even though it's real in the data.

Should I resize or compress an image first?

Resize first, almost always. Serving a 4000-pixel-wide photo — straight off a modern phone camera — into an 800-pixel slot on the page means the browser downloads and discards 96% of those pixels before a single quality setting even matters. Resize to the actual display size, then compress that correctly-sized file; the combined savings beat cranking down quality alone by a wide margin.

JPG, PNG, or WebP: which is smaller?

For photographs, WebP and lossy JPG are far smaller than PNG, which is a lossless format built for flat-color graphics, text, and transparency. For screenshots, logos, or icons with sharp edges and solid colors, PNG (or SVG if it's vector art) usually looks better and weighs less than forcing that content through JPG.

Why does a JPG get worse every time I save it?

Because every time you open, lightly edit, and re-save a JPG, the lossy encoder re-runs its quantization pass on an image that already lost information in the previous save — even if nothing visible changed. Rounding errors stack up across generations, so a photo re-saved ten times looks worse than the same photo compressed once at a lower quality. Always edit from the original file and export the compressed JPG only once, as the final step.

Is it safe to compress personal or client photos in an online tool?

That depends on whether the tool uploads your file to a server. Docuboxer's compressor runs entirely in your browser — the image never leaves your device — which matters for photos carrying location data or client work you shouldn't be sending to a third party.

Compress your images now

JPG, PNG, and WebP, processed 100% in your browser. Free, no limits.

Open Compress images →

Related tools

You might also like: converting HEIC to JPG and how to compress a PDF without losing quality.