To compress images without visible loss, work in this order: scale the picture down to the size it will actually be displayed at, compress photos at a quality between 75 and 85, and switch to WebP if the image is going on the web. Those three steps usually make a photo several times lighter with no difference anyone will notice. This article explains what the quality setting really controls, when working to a target file size makes sense, and how the order of your steps changes the result, so that image compression becomes a routine rather than guesswork.
When a page feels slow, the culprit is usually not JavaScript but pictures that are heavier than they need to be. A well-compressed picture is indistinguishable from the original; the only difference is that it arrives on screen much sooner.
For the hands-on part, the image compressor and the image resizer work as a pair; if the container has to change too, use JPG to WebP or PNG to AVIF. Tightening the frame also buys bytes, and the image cropper often beats compression outright for that. With all of these, the file is uploaded to the server, processed within the same request and returned to you; it is not stored.
How image compression translates into load time
A visitor keeps feeling that a page is loading until the largest visible element has been painted. Core Web Vitals measure that moment as LCP, Largest Contentful Paint, and on most pages the element in question is a picture. So a hero shot that weighs 220 KB instead of 1.8 MB shows up directly in perceived speed. The arithmetic is simple: the roughly 1.5 MB difference is 12 megabits, which on a mobile connection pulling 10 megabits per second is more than a full second of extra waiting.
There is a second, quieter effect. Heavy pictures do not only delay themselves; they hold fonts and stylesheets in the queue behind them on the same connection. Halve the total image weight of a page and you will see unrelated elements arrive earlier too.
What the quality setting actually controls
Quality is not a percentage of anything you can see. It is a threshold that decides how much detail the encoder is allowed to discard. In the compressor it runs from 20 to 95 with 82 as the default, and the scale is not linear. Dropping from 95 to 85 shaves off a noticeable slice of the file with no visible change. Going below 60 starts producing blotches in flat areas and smears the edges of type. PNG behaves differently: there is no lossy encoder, so a lower setting reduces the color palette instead.
A practical routine: export the same picture at 85, 75 and 65, view all three at their intended display size, and stop one step above the first one that bothers you. That threshold moves with subject matter. A portrait can stay clean at 70, while a cover with fine lettering may fall apart below 85.
Working to a target size
Sometimes “looks fine” is not the requirement and a hard ceiling is: a marketplace caps uploads at 500 KB, an application form wants everything under 200 KB. In target-size mode you do not pick the quality value; the tool sets it according to the kilobytes you ask for, up to a ceiling of 5120 KB. Treat it as an approximate target rather than a guarantee: quality never drops below 20, so with a very small target the output can land slightly above it.
The trap is that an unrealistic target collapses quality silently. Squeezing a 3000-pixel-wide photograph into 80 KB may be technically possible and practically useless. When you find yourself there, the answer is fewer pixels, not more compression.
What the compressor does to each format
The compressor never changes the format: a JPG goes in and a JPG comes out, a PNG stays a PNG. What it does inside each format differs, though:
| Input | How it is compressed | Watch out for |
| JPG | Lossy re-encode at the chosen quality | Little to gain on an already low-quality JPG |
| WebP | Lossy re-encode, transparency kept | Keep logos and icons at high quality |
| AVIF | Lossy re-encode | Takes longer than the other formats |
| PNG | Color palette reduced | Smooth gradients can show banding |
| GIF | Palette compression | An animated GIF keeps only its first frame |
One more detail: the compressor strips metadata, EXIF included. That removes personal data such as the location a photo was taken, which is good for privacy and saves a few kilobytes. The color profile can go with it, though, so photos shot in a wide color gamut may shift slightly in tone. For a product shot where color accuracy matters, check the result next to the original.
Order of operations: resize first, compress last
Keeping a picture at 4000 pixels wide and dropping quality to 50 is a very different bargain from scaling it to 1600 pixels and leaving quality at 85. The second option wins nearly every time, on both weight and appearance. Preparing a phone photo for a blog post looks like this:
- Work out the display size: a picture rendered 800 pixels wide in the content column needs a 1600-pixel file to cover high-density screens.
- In the resizer, enter 1600 as the width and leave the height empty; with a single value the aspect ratio is kept and the format stays the same. Each edge is capped at 4000 pixels.
- If there is dead space at the edges, tighten the frame with the cropper so the encoder has fewer pixels to describe.
- If the page will serve WebP, convert now; the converter writes WebP at quality 90.
- Compress last, starting at quality 82; if the file is still too heavy, enter 150 as the target size in KB.
- Check the result at 100% zoom, looking at faces, lettering and dark areas.
The logic is that every step leaves less work for the next. Change container once: bouncing a file between lossy formats burns quality on every hop.
How many sizes should you produce
Serving one file to every screen is easy and expensive: a phone downloads the version prepared for a desktop monitor. Generating a separate file for every breakpoint, on the other hand, quickly becomes unmanageable. Three sizes cover most projects: roughly 640 pixels wide for phones, 1280 for laptops and 1920 for high-density displays.
It is also worth nudging quality up a notch on the smaller variants. As a picture shrinks, each pixel carries more information, and artifacts invisible in a large file become obvious in a small one. Saving the 1920-pixel copy at 80 and the 640-pixel copy at 88 keeps both looking clean and still leaves total weight low.
Which steps buy the most bytes
| Step | Typical saving | Visible risk | When to use it |
| Halving the dimensions | 60% – 75% | None, if display size is right | Always first |
| Quality 95 down to 82 | 35% – 50% | Very low | On photographs |
| JPG replaced by lossy WebP | 25% – 35% | None | Photos published on the web |
| PNG replaced by lossless WebP | About 26% | None | Graphics and screenshots |
| Quality below 60 | 15% – 25% | High | Preferably never |
Halving the dimensions leaves a quarter of the pixels, so the first row is geometry rather than opinion; the WebP rows reflect the typical figures in Google's published comparisons. Your own files will vary, but the ordering is the point: the biggest win carries the smallest risk. Most teams invert it, squeeze quality first, never touch dimensions, and end up with pictures that are both ugly and still heavy.
Common mistakes in image compression
- Recompressing an already-compressed export. Re-encoding lossy output as lossy again saves little and degrades a lot. Go back to the master whenever one exists.
- Forcing a transparent asset into JPG. JPG has no alpha channel, so the transparent area is flattened to white, and nothing brings it back.
- Feeding an animated GIF to the compressor. It keeps only the first frame; skip this step if the animation matters.
- Applying one setting to an entire library. A product photo, a screenshot and a flat illustration respond very differently to the same numbers.
- Reviewing only on a laptop screen. Artifacts are most obvious on high-density phone displays and in dark tones.
For batch work, a queue accepts up to 20 files at a time, each under the 24 MB per-file ceiling, and no image may exceed 50 megapixels or 16,384 pixels on a side. If you are starting from camera originals, spend the first pass purely on dimensions; the second pass then has far less to do.
Measuring whether it worked
Three numbers are enough to know if the effort paid off: total image weight on the page, the weight of the single largest picture, and the moment that picture becomes visible. The network panel in your browser's developer tools hands you the first two directly. For the third, load the page with connection throttling on, which comes closest to what a real visitor experiences.
Targets help too. Keeping total image weight on a content page under 500 KB, with no single picture above 150 KB, is achievable for most projects. Hitting that bar almost never comes from one setting; it comes from dimensions, container and quality pulling in the same direction.
Measuring once is not enough either. New content keeps arriving, and an archive cleaned once grows heavy again, because compression is rarely a fixed step in a publishing routine. The cheapest fix is one line on the pre-publish checklist: “Is the hero image under 150 KB?” If not, the post waits.
Frequently asked questions
Why is 82 the default quality?
Because across a wide range of subjects it sits close to the lowest value nobody notices. Higher inflates the file, lower starts leaving traces on certain pictures. If your own library suggests a different number, use it; a default is a starting point, not a rule.
Does compression change the resolution?
No. Compression reduces the data used to describe the pixels, not the number of pixels. Changing width and height is a separate operation, and it should happen first.
Why does the target size not match exactly?
The encoder adjusts quality in whole steps, and how many kilobytes each step is worth differs from picture to picture, so the result can land a little under or over. With a very small target, quality bottoms out at 20 and the file can still be too large. Reduce the dimensions in that case.
Are my files stored anywhere during processing?
The upload goes to the server, is compressed within that request and comes straight back to you; it is not stored or shared. Even so, with documents that contain personal details it is a good habit to crop the sensitive regions out before uploading anywhere at all.
For how the container itself shifts these numbers, see how to choose an image format; if you are about to process dozens of files at once, the batch image conversion workflow covers sequencing. If you have to get a photo under a specific size for a form or upload limit, how to reduce image file size walks through it, and what is WebP explains the format before you switch.