"Compress without losing quality" is, strictly speaking, a contradiction. Lossy compression is the only kind that delivers the dramatic file-size reductions people actually want, and it works by throwing away image data the human eye is unlikely to notice. The "without losing quality" part isn't a guarantee — it's a target you hit by being smart about which data you discard.
This guide walks through how image compression actually works, what JPG quality settings really mean, when resizing matters more than re-encoding, and how to compress an image to a specific target size without obvious artifacts.
What lossy compression actually does
Every modern image format that produces small files — JPG, WebP, HEIC, AVIF — uses some variation of the same trick: the discrete cosine transform (DCT) or its descendants. The image is broken into 8×8 pixel blocks, each block is converted from pixel values into a frequency representation, and the high-frequency components (the fine detail your eye doesn't dwell on) are discarded with increasing aggressiveness as quality decreases.
This sounds destructive, but human vision is the redeeming factor:
- Your retina has roughly 6 million color cones but 120 million luminance rods. You see brightness much more sharply than color.
- Spatial vision is logarithmic — you're far more sensitive to low-frequency content (large gradients, broad shapes) than high-frequency content (small textures, edges).
- Edge masking causes you to miss fine detail next to high-contrast edges.
JPG exploits all three. It encodes brightness at full resolution but downsamples color (4:2:0 chroma subsampling — color at quarter resolution). It quantizes high-frequency DCT coefficients aggressively. And it allocates more bits to broad gradients than to noise-textured detail.
The practical implication is that a "high quality" JPG is invisibly different from the original even though the file is 10–20× smaller. The first ~80% of the file size reduction is almost free; the last 20% is where you start trading visible artifacts for kilobytes.
What JPG quality actually means
The JPG quality slider is misleading in two ways.
First, it's not linear. The setting nominally goes 1–100, but the curve from 50 to 100 has perceptual cliffs. Most modern encoders are calibrated such that:
- 100 is technically lossless-ish — nearly identical to the original, but already 10× smaller than uncompressed
- 95 is invisibly different from 100, with another ~30% file size reduction
- 85 is the sweet spot for most photos — 50% smaller than 95, no visible artifacts on natural images
- 75 starts showing block artifacts on flat gradients (skies, skin)
- 60 is where compression artifacts become obvious on detail
- 30 is "this image was compressed" obvious
Second, the quality setting is not a guarantee of file size. A photo of an evenly lit gray wall at quality 85 might be 50 KB; a photo of a busy market at the same quality might be 5 MB. The encoder is targeting visual quality, not file size — actual size depends on how compressible the image is.
For most use cases, stay at quality 85 or above. The savings from going lower are modest, and the visual cost is large.
Why resizing usually matters more
Here's the result that surprises most people: if you have a 4000×3000 photo from a phone camera and you need it under 200 KB, resizing to 1600×1200 first, then compressing, will produce a better-looking image than compressing the full-resolution version harder.
The math:
- A 4000×3000 image has 12 million pixels.
- A 1600×1200 image has 1.92 million pixels — 6.25× fewer.
- At identical quality settings, the smaller image will be about 6× smaller in file size.
- More importantly, at the smaller resolution, every pixel that does survive is at full quality, so the image still looks sharp.
By contrast, compressing the full-resolution image hard enough to hit 200 KB requires aggressive quality reduction that produces visible artifacts: blockiness in skies, color bleeding around edges, smearing in fine detail.
The rule: if your image is being viewed at a smaller size than its source resolution (almost always the case for the web, email, and uploads), resize first, then compress.
The web's typical display widths are:
- Desktop hero images: 1920px
- Article body images: 800–1200px
- Social media previews: 1200×630
- Email signatures: under 600px
- App avatars / thumbnails: under 256px
Most camera photos are 4000+ pixels wide. You can lose 75% of the resolution without anyone noticing.
Hitting a target file size precisely
Some uploads are strict: government forms with a 100 KB cap, airlines that reject anything over 200 KB, university applications with arbitrary 1 MB ceilings. Hitting an exact target is its own optimization problem.
Most converters use a bisection approach: pick an initial quality, encode, measure the result, adjust quality up or down based on whether the file came in over or under target, and repeat. This converges in roughly 4–6 iterations.
The Transmute tools that hit specific targets — compress to 100 KB, compress to 200 KB, compress to 1 MB — use this bisection approach with one extra step: if the bisection can't reach the target by adjusting quality alone (because the image is too high-resolution for the target size), they automatically resize first, then re-bisect.
This "resize-then-compress" fallback is what makes hitting tiny targets feasible. A 4K photo cannot fit in 100 KB without becoming visually destroyed — but a 1280×960 version of the same photo at quality 80 can.
Format-specific tradeoffs
JPG isn't the only option. The format you pick affects how much quality you preserve at a given file size.
WebP beats JPG by 25–35% at the same visual quality. If your delivery target supports WebP (every modern browser does), converting to WebP is essentially free file-size savings. The cost is that WebP isn't universally supported in older software.
AVIF beats WebP by another 20%. It's the best lossy compressor currently in production. Use AVIF to JPG for the reverse direction when needed.
PNG is lossless, so "compression quality" doesn't apply — but if your image is a screenshot, a logo, or anything with sharp edges and few colors, PNG can be smaller than a high-quality JPG. PNG only encodes what's there, so a 100×100 logo with 4 colors compresses to a few KB regardless of resolution.
HEIC is comparable to AVIF for photos but suffers from compatibility limits — see the separate guide on HEIC vs JPG.
Common mistakes
Re-encoding repeatedly. Each time you save a JPG, you re-quantize the DCT coefficients. After 5–10 generations, even quality 95 photos start showing visible degradation. Workflow: edit in a lossless format (PNG or original HEIC), export to JPG only at the final step.
Compressing at full resolution when you're going to display small. If your image will be shown at 800px wide on a blog post, no amount of quality optimization on the 4000px source will help. Resize first.
Trusting "lossless" toggles in arbitrary tools. Many "compress losslessly" tools actually re-encode at quality 95 and call it lossless because the perceptual difference is negligible. True lossless re-encoding is rare and usually only useful for stripping metadata or re-packing PNG files.
Optimizing for desktop when most traffic is mobile. A typical phone screen is 750–1080px wide. Anything beyond that is wasted bandwidth. Save smaller versions, or rely on <img srcset> to deliver appropriately sized variants.
Stripping metadata thoughtlessly. EXIF data takes only a few KB but often contains useful information — orientation flags (which prevent your image from showing up rotated), color profile, copyright. Strip GPS and personal data, but keep orientation and color profile. The EXIF viewer lets you inspect what's actually in there.
A practical workflow
For a typical "I need to upload this photo and the form has a size limit" scenario:
- Check the limit. Most government and university forms specify it explicitly. If it's under 1 MB, you'll likely need to resize, not just compress.
- Resize first. Most uploads are reviewed on a desktop monitor at 1920×1080 or smaller. Resize to that — the image resizer preserves aspect ratio automatically.
- Compress to target. Use compress to 1 MB, 200 KB, or 100 KB depending on the cap.
- Verify the result. Look at the compressed image at 100% zoom on a real screen. If you see block artifacts on smooth areas, the compression went too far — try resizing more aggressively before re-compressing.
For a "I want to optimize my entire photo library for storage" scenario:
- Decide your archival format. JPG quality 95 for compatibility, or HEIC/AVIF for max efficiency if your devices support them.
- Resize archival copies to a sane maximum — 4000px wide is usually plenty.
- Keep original untouched copies somewhere separate (a second drive, a cloud backup) so you can always re-process from the source.
For a "I'm publishing images to my website" scenario:
- Resize to display size — 1200px wide for body images, 1920px for hero images.
- Convert to WebP or AVIF for the production version. Keep a JPG fallback for older browsers if you need to.
- Strip unnecessary metadata (GPS, camera serial). Keep color profile and orientation flag.
The short version
The phrase "compress without losing quality" really means compress in a way the human eye is unlikely to notice. The way you accomplish that is the same in every workflow: pick a sensible quality (85 or higher for JPG), resize to the resolution you'll actually display the image at, and trust that the encoder has been calibrated by people who studied human vision for a living.
For everyday compression, the image compressor handles the quality-control side. For specific size targets, compress to 100 KB, 200 KB, or 1 MB automate the resize-and-bisect logic. Both run in your browser; nothing leaves your device.