How to compress an image without uploading it (and why that matters)

You want a photo small enough to attach to an email or a form, but you do not want a random website to keep a copy of it — faces, documents, the GPS tag your phone quietly added. Compression does not have to mean an upload.

What most “free compressors” actually do

The usual pattern is: you pick a file, the browser uploads it, software on their server (ImageMagick, libvips, a paid API) re-encodes it, and you download the result. Even honest services briefly hold a copy of your photo — and with it any faces, screenshots, documents, and the hidden EXIF location data phones embed. Some keep files to train models or show in a public gallery. If the page has a progress bar that sits on “uploading” or you see a request to their domain in the network panel, the picture left your device.

A page that works offline once loaded, or that still compresses after you turn on your browser’s “offline” mode, is drawing the picture locally.

How in-browser compression works

Modern browsers can decode JPEG, PNG, WebP, GIF and BMP without help. The page asks the browser for a bitmap (and, on recent browsers, to apply the photo’s stored orientation so a phone picture is the right way up), draws it onto a <canvas>, and calls toBlob() with a type and a quality between 0 and 1. You then download that new file. The original bytes are never posted anywhere.

Two knobs change the size:

Which format should I pick?

FormatBest forWatch out for
JPEGPhotos. Universally supported. Small at quality 70–85.No transparency (the missing bits become a solid background, usually white). Repeated re-saving adds more softness.
WebPPhotos or graphics when you want a smaller file than JPEG, and when transparency matters.A few older apps and email clients still will not open it. If in doubt, keep a JPEG as well.
PNGScreenshots, diagrams, anything that must stay perfectly sharp, or that needs a transparent background.Photos saved as PNG stay large. Quality sliders do not apply.

Animated GIFs: a canvas only sees one frame, so the result is a still. HEIC (the default on many iPhones) is often readable in Safari but not in other browsers; share or export the photo as JPEG first if the page cannot open it.

Aiming at a file size

A job application form that says “under 200 KB” is not asking you to guess a quality number. A compressor can try several quality settings (and, if that is not enough, slightly smaller dimensions) until the file fits. That is what the target-size box on the image compressor does: type 200 KB or pick the email preset.

What you lose, honestly

What you do not lose is the picture itself: faces and text that are in the pixels stay in the pixels. Compression is not redaction. If the photo should not be seen, do not send the file.

Related

Phone storage full? Where the space goes · How to tell if compressing a photo ruined it · Get a photo under 100 KB for a form · Megapixels vs file size · Rotate a JPEG without losing quality · Lossless vs lossy compression · Compress many photos at once · Why zipping photos does not make them smaller · Remove GPS and other hidden tags from a photo · Resize an image without uploading it · Convert PNG to JPEG or WebP · Photo too large to email · Image compressor · Base64 encode (if you then need a data URI) · Hash a file locally

Questions

Do online image compressors upload my photo?

Most of them do: the file is sent to their server, re-encoded, and sent back. A local tool uses your browser’s canvas instead, so the file never leaves the page.

Is it safe to compress ID photos or screenshots this way?

Safer than uploading them, because nothing is transmitted. The pixels themselves still contain whatever was visible, so treat the download with the same care as the original.

Quality or resize: which shrinks a photo more?

For a large phone photo, resizing to the width you actually need (for example 1920 px) usually saves more than lowering JPEG quality alone. Using both is fine.

Why is my PNG still huge?

PNG is lossless. It is a poor choice for photographs. Save a photo as JPEG or WebP, and keep PNG for screenshots and sharp graphics.

Will the compressed file still have my location in it?

No, if it was redrawn onto a canvas and saved as a new file. That process drops EXIF tags, including GPS. A longer explainer is at the companion guide on removing location data.

Published · updated .

Try it

Related guides

Newest guides