Skip to content
All guides
8 min read

How to compress images without uploading them

You can compress photos for email or the web without sending the original to a server. Here is how browser-local compression works, and when a cloud encoder still wins.

Most “compress image online” pages take the file, encode it on a server, and hand you a download. That is fine for a public product shot. It is the wrong default for a passport scan, a child’s photo, or a screenshot that still has a chat thread in it. You can shrink the file in the tab instead.

What a private compressor actually does

StackImage reads the image with the browser’s decoders, optionally resamples it, and writes a new file with HTMLCanvasElement.toBlob. JPEG, WebP, and AVIF use lossy quality steps (about 90 / 75 / 55 for Light, Balanced, and Extreme). PNG export is lossless. There is no upload API for your pixels.

When smaller files actually help

  • Email and chat attachments that bounce at 10 or 25 MB.
  • Hero images and blog photos, where web.dev’s image guidance still starts with “make the file smaller.”
  • A folder of screenshots you want to archive without keeping 12 MB PNG originals.
  • A WebP or AVIF pass after you already cropped or resized.

How to compress a photo in StackImage

  1. Open Compress Image and drop one file or a batch (up to 24, 50 MB each).
  2. Pick Light, Balanced, or Extreme, and the output format.
  3. Check the before/after preview and the new file size.
  4. Download the result, or a ZIP if you dropped several files.

Compress an image privately

JPG, PNG, WebP, and AVIF. Files stay in this browser.

Compress an image privately

Limits that protect the tab

Images above 32 megapixels or 50 MB are rejected. That is a stability cap, not an upsell. A 60 MP phone dump can crash a tab if we pretend the browser is Photoshop. Resize first if you only need a 1920-pixel-wide share copy.

When you should still use TinyPNG or Squoosh

Use TinyPNG when the photo is already public and you need the smallest CDN asset their encoder can produce. Use Squoosh when you want per-codec sliders (mozjpeg, oxipng, AVIF effort) on a single file. Use StackImage when the picture should not leave the machine and “good enough for email” is the job.

Sources

web.dev: Compress images

Google’s baseline advice on why bytes still matter for LCP.

web.dev: Compress images

MDN: HTMLCanvasElement.toBlob()

The browser API StackImage uses to write the download.

MDN: HTMLCanvasElement.toBlob()

Try these tools

More guides