Image Compressor

Say how big the file is allowed to be and this finds the settings that get there — trying quality after quality until it fits, and shrinking the picture only if it has to.

Runs entirely in your browser — nothing is uploaded

What this does

Some form somewhere wants your photo under 200 KB, and your phone just handed you a 4 MB one. This closes that gap: you type the limit, and it works out the settings that meet it — testing quality after quality until the file fits, and reducing the dimensions only when quality alone can't get there.

That's a different question from the one most compressors answer. A quality slider is no help when you don't know which number produces 200 KB, because the answer depends entirely on the picture: a plain sky compresses to a fraction of what a crowd scene does. Working backwards from the size you need is the useful direction, and it's the one this takes.

How to use it

  1. Drop your image in, or click to choose one.
  2. Type the limit, or press one of the preset sizes.
  3. Check the result — Show the original flips between the two so you can see what the compression cost — then download.

How it finds the setting

Image compression has no formula that turns a target size into a quality setting; the only way to know how big a file will be is to make it. So the tool makes several, in a deliberate pattern: it starts at the best quality worth asking for, and if that's too big, at the lowest it's willing to use. If the low end fits, the answer is somewhere between the two, and each further attempt halves the remaining range. Six or seven tries pin it down closely enough that another one wouldn't change anything you could see.

When even the lowest quality is still too big, no setting will do it and the picture itself has to be smaller. The next size is worked out from what it just measured rather than guessed — file size tracks pixel count fairly closely, so if the file needs to be a quarter smaller, each side needs to come down by about half of that in proportion. Then the quality search runs again at the new size.

The whole search runs on a single drawing of your image, encoded over and over. Redrawing it each time would multiply the slowest step by ten for no benefit.

Quality or dimensions?

Both make a file smaller and they fail differently. Lowering quality keeps every pixel but degrades them, and past a point JPEG starts showing blocks and halos around edges — most visibly on text, logos and anything with a hard line. Shrinking keeps the quality of what remains and simply gives you less of it.

For a hard target, dropping quality to about 40% and then shrinking gives a better-looking result than pushing quality into the teens, which is why the tool does it in that order. If your dimensions are fixed — a form that demands 600×800 exactly — untickShrink the picture if it has to and quality will take the whole hit.

Which format

Left to itself, this saves as JPEG, which every system on earth accepts, unless your image has transparent areas — in which case it uses WebP, because JPEG has no way to store transparency and would fill those areas with a flat colour. You can override it either way.

WebP is typically 25–35% smaller than JPEG at the same visible quality, so if the receiving end accepts it, it will hit your target with more quality to spare. PNG isn't offered here: it's lossless, so there's no quality dial to turn, and it can't be steered to a size.

Is my image private?

Yes. Everything happens inside this page — the image is decoded, drawn and encoded by your own browser, and no version of it is ever uploaded. You can watch the network panel stay silent, or pull the plug on your connection after the page loads and carry on working.

Because the picture is redrawn from its pixels, the file you download carries none of the original's metadata: no location, no camera model, no timestamps. That's usually welcome before sending a photograph to a stranger, and worth knowing if you needed those fields kept.

Frequently asked questions

Does "KB" mean 1,000 bytes or 1,024?

Here it's 1,024, which is what Windows and most upload checks use. If the form you're feeding is strict and counts in thousands, aim a little under — asking for 195 KB will clear a 200,000-byte limit comfortably.

Why can't it hit my target exactly?

Because it aims to come in under the limit, which is what a limit means. You'll usually land within a few percent below it. Landing exactly on a number isn't possible with a lossy encoder — the size moves in jumps as the quality setting changes.

It says it couldn't reach my target.

Then the target is smaller than the picture can go while staying recognisable — a 50 KB limit on a detailed photograph, for instance. You'll still get the smallest version it managed, and it will tell you what that came to. Allowing it to shrink the picture, or switching to WebP, usually gets you the rest of the way.

Will compressing twice make it smaller still?

A little, and it will look worse each time — JPEG loses information at every save, and losses compound. Always compress from the original rather than from a compressed copy.

What about animated GIFs?

Only the first frame survives, since this works through a canvas, which has no notion of an animation. For animation, this is the wrong tool.

← Browse all Gwibbo tools