JPEG compression is a trade-off you’re making every time you save or export a photo, whether you realize it or not — the question isn’t whether to compress, it’s how much, and getting that number right for your specific use case is what this guide covers.
How JPEG compression actually works, briefly
JPEG exploits two things about human vision: we’re much less sensitive to fine detail in color than in brightness, and we’re much less sensitive to high-frequency (fine, rapidly changing) detail than to low-frequency (smooth, gradual) detail. Chroma subsampling handles the first by averaging color information across small blocks while keeping brightness detail nearly full-resolution. The DCT (discrete cosine transform) quantization step handles the second by more aggressively rounding away fine detail as the quality setting drops, within 8x8 pixel blocks. Both of these are lossy — some information is genuinely discarded, not just efficiently packed — and both happen more aggressively as quality decreases.
Why quality 100 isn’t “lossless”
A common assumption is that JPEG quality 100 preserves the original exactly. It doesn’t: most encoders still apply some chroma subsampling by default at quality 100, and the DCT step still introduces small rounding errors regardless of quality setting — JPEG has no truly lossless mode in standard use. The practical effect is that quality 100 produces a file that’s visually indistinguishable from the source for virtually anyone, but meaningfully larger than quality 90-95, for a difference that doesn’t show up in normal viewing. Unless you have a specific reason (archival intent, further heavy editing planned), quality 100 is usually wasted file size.
Picking a quality setting for your use case
- Final photos, viewed at or near full resolution (a portfolio, a photo you might print): 85-92. This is close to the point of diminishing returns — going higher rarely produces a visible improvement, going lower starts to.
- Web images, displayed smaller than their native resolution: 70-80 is often enough, because downscaling in the browser itself smooths over minor compression artifacts that would be visible at full size.
- Thumbnails and small preview images: 60-70, since small display size hides moderate compression artifacts almost entirely.
These aren’t universal constants — a photo with lots of fine texture needs a somewhat higher setting than a simple portrait to look equally clean at the same size, because JPEG’s compression targets exactly that kind of high-frequency detail.
The compounding mistake: compressing more than once
Every JPEG compression pass makes its own independent rounding decisions on an 8x8 pixel grid. Decompress and recompress that file, and the second pass’s grid rarely lines up with the first’s — instead of one clean set of compression artifacts, you get two overlapping, misaligned sets, which look noticeably worse than either pass alone would suggest. This is the actual mechanism behind the common observation that a photo “look[s] worse” after being downloaded and re-uploaded a few times across different platforms. Whenever possible, start from the original, uncompressed (or least-compressed) source file you have, and compress once at the quality you actually need.
Resize first, then compress
If you’re also changing the image’s dimensions, do that before compressing, not after. Compressing at full resolution and then resizing down wastes bits encoding detail that gets discarded by the resize anyway, and can occasionally introduce new artifacts as the resize algorithm processes already-blocky pixel data. Resize to the final dimensions first, then let the compressor work only with the pixels that will actually be seen.
Frequently asked questions
- Is JPEG quality 100 the same as the original, uncompressed photo?
- No. JPEG is a lossy format at every quality setting, including 100 — chroma subsampling (averaging color detail across small blocks) happens by default even at maximum quality in most encoders, and the DCT-based encoding still introduces tiny, usually invisible rounding errors. Quality 100 is 'visually lossless,' not bit-for-bit identical to the source. It also produces a much larger file than quality 90-95 for a difference no one can see, so it's rarely the right choice.
- What quality setting should I actually use?
- For final photos meant to be viewed at full size (a portfolio, a print), 85-92 is the practical sweet spot — visually indistinguishable from higher settings for almost everyone, at meaningfully smaller file sizes. For web images that will be displayed smaller than their native resolution, 70-80 is often enough since downscaling itself hides minor compression artifacts. Below 60, artifacts become visible to most people even without zooming in.
- Why does compressing the same photo twice make it look worse than compressing it once at a lower quality?
- Each JPEG compression pass makes independent rounding decisions based on an 8x8 pixel block grid. If you decompress and re-compress an already-JPEG image, the second pass's block grid rarely aligns exactly with the first pass's, so you get two overlapping, slightly different sets of block artifacts instead of one clean set — this compounds visible degradation faster than a single pass at an equivalent combined quality loss would. This is why it's always better to compress once, from the original source, at whatever quality you actually need, than to compress repeatedly in smaller steps.
- Does the image content change what quality setting I need?
- Significantly. Photos with lots of fine, irregular texture — grass, water, fabric, foliage, crowds — need a higher quality setting to avoid visible blocking than photos with large smooth areas — a portrait against a plain background, a product shot on white. This is because JPEG's compression targets high-frequency detail specifically, and busy images simply have more of it to lose.
- Should I resize before or after compressing?
- Resize first, then compress. Compressing a large image and then resizing it down afterward wastes the compression pass on detail that gets thrown away by the resize anyway, and can occasionally introduce new artifacts when the resize algorithm processes already-blocky data. Resizing first means the compressor is only working with the pixels that will actually be displayed.