Guide · Compress

Compress PNG for email size limits

Many mail systems reject or silently bounce large screenshots. Shrink the file to a target KB in your browser — your pixels are not uploaded to LocalPix.

Email clients and gateways often enforce attachment limits around 10–25 MB for the whole message (provider-dependent). A single full-resolution PNG screenshot can already be several megabytes; a short burst of them fails before you hit “Send.” The goal is a predictable file size, not a prettier palette.

What “compress for email” actually means here

LocalPix Compress to KB re-encodes the image as JPEG with a local quality search aimed at your target size. That is a size budget tool, not a lossless PNG optimizer. Transparency becomes a flat background once you leave PNG. If you must keep an alpha channel, stay on PNG and crop or downscale outside this tool — or accept that email-friendly delivery usually means JPEG or a smaller WebP that the recipient can open.

Pick a target before you open the tool

These are planning bands, not guarantees from any mail host. The tool’s number is the download size on your disk after encode.

Steps (local, 0-byte upload)

  1. Open Compress to KB. Drop a PNG, JPEG, or WebP. HEIC will not decode here. Compress stays disabled until a file is chosen. Optional: Verify local with DevTools Network open.
  2. The Target KB field opens at 100 and accepts 10 to 5000. Replace 100 with the size you actually want, for example 200 or 400 when the screenshot has UI text.
  3. Press Compress. Ten probes search JPEG quality from 0.10 to 0.95. The pixel width and height do not change. The download is compressed.jpg. Read the status, then the size on disk. The last probe can sit a little over the number you typed.
  4. If the UI text blurs, raise the target and press Compress again. A readable 400 KB file beats an illegible file the portal accepts.
  5. Attach compressed.jpg, not the original PNG. Alpha is gone. If the PNG was already under the cap, skip the tool. Re-encoding is unconditional and can make a small icon larger.

PNG-specific pitfalls

How it works

Compress to KB decodes the PNG in the tab and binary-searches JPEG quality. The canvas keeps naturalWidth and naturalHeight. The loop runs ten times, with quality moving between 0.10 and 0.95. Each step calls canvas.toBlob with type image/jpeg and keeps the blob when it is the latest probe. The comparison is blob.size / 1024 against the target you typed, so 150 means about 150 of those KB, not a promise from a mail host. The download is that blob, named compressed.jpg, from a blob: URL. No ormbg file is fetched. HEIC is not decoded on this path.

The bands above (about 100–200 KB, 300–500 KB, under about 1 MB) are planning numbers for how you fill in the field. They are not measurements of Gmail, Outlook, or any other provider. A gateway that allows 10–25 MB for the whole message can still reject one sharp screenshot, and a gateway with a tighter cap can reject three “successful” 200 KB files plus MIME overhead. The tool never sees the message. It only sees the one image and the integer you typed. Add the attachments up yourself, then leave room for the rest of the mail.

Screenshots of UI text are the case where a low target lies. Quality 0.10 still contains every pixel, so a 4000-pixel-wide capture may stay over 200 KB, and if it does squeeze under, the glyphs smear. Raise the target, or crop to the window that matters and run again. Flat areas of a dialog shrink more willingly than a photo of a noisy scene. That is the codec, not a second optimizer.

Limits

FAQ

Does LocalPix know my mailbox limit?

No. The 10–25 MB range on this page is a planning band for whole messages, and it varies by provider. The tool only aims at the KB you type for this one file.

Will the JPG land under the KB I typed?

Often, not always. Ten quality probes compare blob.size / 1024 with your number. If the lowest probe is still larger, the status shows that real size. Crop or scale the image locally and run it again. The search does not change width or height.

Does the PNG get uploaded?

No. Decode and the JPEG search stay in the tab. The download is a local blob: URL named compressed.jpg. No background-removal model is fetched. Verify local.

Will a transparent screenshot keep its holes?

No. The result is a JPEG. Alpha is discarded, and this tool does not paint a white plate first. Flatten the image if the recipient must see a particular background, then compress.

I am attaching four screenshots. Does 200 KB each mean the mail is 800 KB?

The images add up, and the mail is larger than that sum once MIME headers are included. Budget the total before you send. This page compresses one file at a time and never sees the message.

The screenshot is a HEIC from the phone. What runs first?

HEIC to JPG. Compress does not load libheif. After you have a JPEG, come back and set a target only if that JPEG is still over the cap you are aiming at.

Sources

Related tools

Compress to KB · 100 / 200 / 500 KB attachment caps · HEIC to JPG · WebP to JPG · Verify local

Related guides