Uploading limits are everywhere: a visa application wants under 200 KB, a marketplace listing caps at 1600×1600 and 500 KB, a government form says 2 MB. So the question is rarely "make this smaller" — it is "make this exactly this size, and do not make it look bad".

Which knob to turn, in order

Quality and dimensions are not equally powerful. Halving the dimensions removes about three quarters of the pixels and usually lands the file on target while keeping it sharp. Cranking quality from 80 down to 15 gets you the same saving with visible artefacts, and it is almost always the wrong order.

  1. Try to fit the target at the original dimensions by lowering quality only. Best possible result if it works.
  2. If the target is still out of reach, scale the dimensions down and retry.
  3. If you fall well under the target, walk the dimensions or quality back up to use the budget you have.

Why the search runs more than once

File size does not move linearly with quality, so guessing one value and hoping is unreliable. A proper implementation measures the result and adjusts — that is why a few seconds of processing buys a file that fits the limit precisely instead of one that is far under it.

WebP or JPEG

For photographic images, WebP is usually 25–35% smaller than JPEG at the same perceived quality. If the destination accepts WebP, converting is almost always the single most effective thing you can do — before touching quality at all.

ImageBest format for a small target
PhotographWebP, then JPEG if the destination rejects WebP
Screenshot, logo, flat colourPNG or WebP lossless — JPEG adds artefacts to hard edges
Image with transparencyWebP or PNG. Never JPEG; transparency is discarded
Line art or text-heavy capturePNG, or WebP lossless

When the target is impossible

A 50 KB target for a detailed 12-megapixel photograph is not achievable at a usable size. Rather than return a 200-pixel thumbnail that will be rejected for being the wrong dimensions, a good tool stops, tells you what happened, and suggests resizing to a specific width first.

This is worth being honest about, because the alternative — silently returning a tiny image and letting the user discover the problem at submission time — is the most common way these tools waste someone's afternoon.

Stripping metadata, and one caveat

Re-encoding an image through a canvas discards EXIF data, including GPS coordinates, camera serial numbers and timestamps. That is genuinely useful before posting a photo publicly.

The caveat is that the same re-encoding applies the orientation EXIF describes. Almost always this is what you want, because it makes the image display correctly everywhere. Very occasionally, a file from an unusual camera produces an unexpected shift, and a before-and-after preview is the fastest way to catch it.

Tools mentioned in this guide