Why image compression is harder than it looks
You have a folder of images that are too large to email, too slow to upload, or too heavy for a web page. Image compression sounds simple until you meet the trade-offs: shrink the file and the picture turns soft, keep it sharp and the file stays huge. This guide explains how compression actually works, which format to pick, and how to judge quality instead of guessing.
The goal is practical. By the end you will know when lossy compression is safe, when lossless is worth the larger file, and how to run a compression pass that leaves your images looking right at the size they will really be viewed.
What image compression actually does
Compression is the process of storing the same picture using fewer bytes. Every method falls into one of two families, and the difference between them decides almost everything else.
Lossless compression
Lossless compression rewrites the file so it takes less space while keeping every original pixel value. Open the file and you get exactly what you started with. Nothing is discarded, so repeated saves never degrade the image.
The catch is the ceiling. Lossless methods usually save somewhere between a modest amount and roughly half the file size, depending on how much repetition the image contains. Flat graphics, screenshots and diagrams with large areas of one colour compress well. Noisy photographs do not, because there is little repetition to exploit.
Lossless is the right default when the image is an archive copy, a text-heavy screenshot, a logo, or anything that will be edited again later. It is also the safe choice when you cannot check the result visually.
Lossy compression
Lossy compression throws away detail the eye is unlikely to miss, then stores what remains efficiently. That is why it wins on photographs: a smooth gradient of sky can be described approximately instead of exactly, and the saving is large.
Lossy is not a single setting. It is a dial. At gentle settings most people cannot tell the difference from the original. Push the dial too far and you get blocky patches in flat areas, smeared edges around text, and colour banding across gradients. Those artefacts are permanent — once detail is discarded, re-saving at a higher quality will not bring it back. It will only add more loss on top.
The one rule that matters most
Compress once, from the original, at the quality you need. Never open a compressed file, edit it, and save it again as a compressed file. Each round trip compounds the damage. Keep your master file untouched and export a compressed copy for each destination.
Lossy vs lossless: which should you choose?
Choose lossless when the image will be edited again, when it contains sharp text or line art, or when file size is not the constraint. Choose lossy when the image is a photograph, when it will be viewed at a normal size on a screen, and when download speed or storage matters more than pixel-perfect fidelity.
A useful test: if you would be upset to lose a single pixel, go lossless. If you only care that it looks right at the size people will actually see it, lossy is usually the better trade.
Which image format should you use?
Format and compression setting are separate decisions, and mixing them up causes most of the confusion. The format sets what is possible; the setting controls how far you push it.
- JPEG — lossy only. Best for photographs and complex images with no transparency. Universally supported.
- PNG — lossless only. Best for screenshots, logos, icons and anything needing transparency. Files get large for photographs.
- WebP — supports both lossy and lossless, plus transparency. Usually smaller than JPEG or PNG at similar quality, with broad modern browser support.
- AVIF — supports both, with strong compression on photographs, but encoding and support vary more widely across tools and older software.
- GIF — limited to 256 colours. Fine for simple animations, poor for photographs.
If you are publishing to the web and your audience uses current browsers, WebP is a sensible default for photographs and PNG remains reliable for graphics with transparency. If you need the widest possible compatibility, JPEG and PNG still work everywhere.
How to compress an image without ruining it
This sequence works for a single file or a batch, and it keeps you from destroying the original by accident.
- Keep a master copy. Store the original file somewhere separate before you touch anything. This is the file you return to if a compression pass goes wrong.
- Decide the final display size first. Resize to the largest dimensions the image will actually be shown at. Compressing a 4000-pixel photo that will display at 800 pixels wastes bytes no matter what quality setting you choose.
- Pick the format for the content. Photograph: JPEG or WebP. Screenshot, logo or transparency: PNG or lossless WebP. Do not force a photograph into PNG.
- Compress at a moderate setting. Start in the middle of the quality range rather than at the extreme. For most photographs this already cuts the file size substantially.
- Compare at 100 percent zoom. View the compressed result and the original side by side at full size, not scaled to fit your screen. Scaling hides exactly the artefacts you are looking for.
- Lower the setting until artefacts appear, then step back up. Find the point where blockiness or smearing becomes visible, then choose the setting just above it.
- Check the real context. Look at the image at the size and on the kind of screen your audience will use. A file that looks fine on a large monitor may look rough on a phone, and the reverse also happens.
- Record what you used. Note the format and setting so the next batch is consistent rather than a fresh guess.
You can run these steps in a browser using the image compression tools on this site. Everything happens locally in your browser, so your files are not uploaded to a server. That is convenient for private or client material, but it also means the work is limited by your own device: very large batches or extremely high-resolution files can be slow or may exceed what your browser can handle in one pass.
Does compressing an image reduce quality?
Yes, lossy compression reduces quality by discarding detail, but the reduction is often invisible at normal viewing sizes. Lossless compression does not reduce quality at all. Whether you notice lossy artefacts depends on the setting, the content of the image, and how closely the viewer looks. A moderate setting on a photograph typically looks identical to the original on screen.
Quality settings, explained without the guesswork
Quality sliders are not standardised. A setting of 80 in one tool is not the same as 80 in another, and the same number can behave differently across formats. Treat the number as a relative dial, not an absolute measure, and judge by looking at the result.
Two practical anchors help. First, most photographs tolerate a moderate setting with no visible change at normal viewing size. Second, images with fine detail — text, thin lines, repeating patterns — fall apart much sooner than smooth images. A portrait and a screenshot may need very different settings to look equally good.
If you cannot see a difference at 100 percent zoom, you have room to compress further. If you can see it, stop and go back one step.
Compressing images for the web
For web pages, the constraint is usually load time rather than disk space. Three habits do most of the work.
Serve images at the dimensions they are displayed at, rather than scaling large files down in the page layout. Choose a format the browser handles well, which for most photographs means a modern format with a fallback. And compress each image individually rather than applying one setting to a mixed folder, because a single slider position rarely suits both a photo and a diagram.
If you are preparing a set of assets, a batch utility saves time. The browser-based tools here can process several files in one session, though you should still spot-check a few results rather than trusting the setting blindly across the whole batch.
Common compression mistakes
- Saving over the original. The most expensive mistake, and the easiest to avoid.
- Compressing an already-compressed file. Quality drops fast with each generation.
- Judging quality on a scaled-down preview. Artefacts hide at small sizes.
- Using one setting for a mixed folder. Photos and graphics need different treatment.
- Choosing lossless for photographs. You pay a large size penalty for no visible benefit.
- Choosing lossy for text and logos. Edges smear and the result looks cheap.
- Ignoring display size. A correctly sized image beats a heavily compressed oversized one.
Frequently asked questions
Is lossy compression always worse than lossless?
No. For photographs, lossy compression at a sensible setting usually looks identical to the original at normal viewing sizes while producing a much smaller file. Lossless is better when you need exact pixel values, when the image will be edited again, or when it contains sharp edges and text.
Can I compress an image more than once?
You can, but you should not re-compress an already compressed file. Each lossy pass discards more detail and adds artefacts on top of existing ones. Always return to the original master and export a fresh copy at the setting you need.
Which format gives the smallest file?
It depends on the content. Modern formats generally beat older ones at similar quality for photographs, and lossless formats are far smaller for screenshots and flat graphics. There is no single winner: match the format to the image rather than to a general rule.
Does compressing an image remove metadata?
It can. Some tools strip embedded information such as camera details and location data during compression, while others preserve it. If metadata matters for your workflow, check what the tool does before you run a batch, and keep a copy of the original in any case.
How do I know if I compressed too far?
Look at the result at 100 percent zoom, in the size and context where it will be used. Visible blocky patches in flat areas, smeared edges around text, or banding across gradients all mean you pushed the setting too far. Step back up until those artefacts disappear.
The short version
Image compression comes down to two choices: whether you can afford to lose detail, and which format suits the content. Lossless keeps everything and saves less. Lossy saves a lot and asks you to check the result. Match the format to the image, compress once from the original, and judge quality at the size people will actually see. Get those habits right and image compression stops being a gamble and becomes a routine step.
This article covers general information about file formats and compression, not professional advice for any specific project.