Compressing Images Without Losing Quality: What Actually Works in 2026
The short version: set quality to 75-80, resize the image to the width it's actually displayed at, and use WebP or AVIF when the destination allows it. That gets most photos from multi-megabyte files down to 100-300 KB with zero visible difference.
I've shipped images this way on production sites for years, and I've A/B tested the settings below with designers who swear they can tell "quality loss" apart at 400% zoom. The numbers hold up. Here's the whole field guide.
Why your 4 MB photo is 4 MB in the first place
Modern phone cameras default to 48-megapixel photos. One shot from an iPhone 15/16 Pro or a Galaxy S-series lands at 5-8 MB before you do anything to it. Meanwhile the biggest any web page will ever display that image is usually 1200-2000 pixels wide.
So you're shipping 48 megapixels to show about 2. That gap — between what the sensor captured and what the screen can render — is where almost all the wasted bytes live. Shrink it once and you barely need to obsess over the rest.
Lossy vs lossless: there are only two buckets
- Lossless keeps every pixel intact. File sizes drop 10-40%. PNG, GIF, and lossless WebP work this way. Right choice for logos, screenshots, and anything with text or sharp edges.
- Lossy discards tiny color and detail variations your eyes rarely register. File sizes drop 60-90%. JPEG, lossy WebP, and AVIF work this way. Right choice for photos.
The trap people fall into: they think "quality 100" is the safe option. It isn't. A JPEG at quality 100 is mostly wasted data — the encoder is preserving artifacts you can't see. The real skill is finding the lowest quality number where you can't see a difference, not the highest one where you can. For photos that number is almost always 75-80.
Pick the format first, compress second
Choosing the format does half the work before you touch a single slider:
| Format | Best for | Typical savings |
|---|---|---|
| JPEG | Photos, web, email | 60-80% at quality 80 |
| PNG | Logos, screenshots, transparency | 10-40% (lossless) |
| WebP | Modern websites | 25-35% smaller than JPEG at the same quality |
| AVIF | Modern browsers | roughly half of JPEG at the same quality |
| SVG | Icons, vector art | tiny, infinitely scalable |
WebP is supported in every modern browser (caniuse lists it as green across the board), and AVIF covers everything except older Safari versions. The easiest win on the web: serve AVIF or WebP with a JPEG fallback and let the browser decide:
<picture>
<source srcset="photo.avif" type="image/avif">
<source srcset="photo.webp" type="image/webp">
<img src="photo.jpg" alt="Your photo" width="1920" height="1080" loading="lazy">
</picture>
That snippet alone will cut your image payload by 50-70% on most browsers, and nobody who visits your site will ever know the difference.
The exact settings I use
These are the numbers I actually ship with, not the ones from a random blog post:
- Quality: 75-80. Start at 80 for photos. Below 60, smooth gradients start to band and edges get crunchy.
- Width: the display width. Resize to the largest size the image will ever be shown at. A 4000px photo displayed at 1200px is about 80% waste.
- Format: WebP or AVIF when possible, JPEG otherwise. For screenshots and logos: PNG or lossless WebP — never lossy.
If you'd rather stay in the terminal, ImageMagick does all three in one line:
magick photo.jpg -quality 80 -resize 1920x1920\> photo.webp
Or in Python with Pillow:
from PIL import Image
img = Image.open("photo.jpg").convert("RGB")
img.thumbnail((1920, 1920)) # resize to display size
img.save("photo.webp", "WEBP", quality=80, method=6) # method=6 = slowest, best compression
And if you want a browser-only option, my tool ArkToolz image compressor does the same thing in the browser — no upload, the file never leaves your device, batch mode handles a whole folder at once.
Four mistakes I see everywhere
- Quality 100. Wasted bytes, no visible benefit. Start at 80 and step down until you notice.
- Recompressing an already-compressed file. Each lossy pass adds artifacts. Always compress from the original.
- Ignoring EXIF. GPS, camera model, timestamps — that's kilobytes of metadata hiding in every photo. Most decent compressors strip it automatically.
- Deleting the original. Compression edits a copy, never the source. Storage is cheap; reshoots are not.
Frequently asked questions
Does compressing an image ruin the quality?
Only if you push lossy compression too far. Between 75-80, the difference is invisible to the human eye. Lossless compression doesn't touch quality at all.
What's the best format for photos in 2026?
WebP at quality 80 is the best size-to-quality balance in most browsers right now. AVIF is smaller still if your audience runs modern browsers. For screenshots and text-heavy images, PNG or lossless WebP.
Can a 5 MB photo really become 100 KB?
Often yes — but usually it takes two levers at once: quality around 75 plus resizing to display width. Either one alone might not get you there.
Go compress something
Format first, then quality 75-80, then display size. That's the whole playbook. A free online image compressor applies all three in one go, right in your browser — drop a file in and watch it come back 60-90% smaller while the quality stays put.
This article was originally published on the ArkToolz blog.
Top comments (0)