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
- ~100–200 KB — typical for a single screenshot in a short reply when you still want readable UI text.
- ~300–500 KB — safer when the shot has fine UI chrome or you are attaching two images under a tight mailbox quota.
- Under ~1 MB — usually enough headroom inside a 10 MB message that also carries other files; still verify your provider’s limit.
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)
- 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.
- 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.
- 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. - If the UI text blurs, raise the target and press Compress again. A readable 400 KB file beats an illegible file the portal accepts.
- 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
- Screenshots with large flat areas often shrink well as JPEG; noisy photos need a higher KB budget for the same perceived sharpness.
- Already-small PNGs (icons, UI crops under ~50 KB) may not shrink further without obvious artifacts — skip recompression.
- Multiple attachments: budget the sum. Three “200 KB” shots are ~600 KB before the email MIME overhead.
- HEIC from a phone: convert first with HEIC to JPG, then compress if the JPEG is still over your limit.
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
- The field accepts 10 through 5000 and opens at 100. There is no setting for a 25 MB mailbox. If the PNG is already under your cap, you can skip the tool and attach the original.
- The search is best-effort. The status line can show a file over the target when even quality 0.10 is larger. The page will not scale the pixels down for you.
- Alpha is discarded. A screenshot that was a transparent PNG becomes an opaque JPEG. Paint the plate you want before you compress if the holes matter. Email rarely wants those holes.
- Re-encoding is unconditional. An already-small PNG still becomes a new JPEG. Icons under about 50 KB are the usual case to leave alone.
- HEIC from a phone is a different tool. HEIC to JPG first, then return here if the JPEG is still over the cap.
- The photo is not posted. The page and the cookieless analytics beacon still load. Verify local if you want that list while the search runs.
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
- RFC 2083, PNG — the screenshot format you are leaving when the mail path wants a smaller JPEG.
- JPEG on jpeg.org — the format
compressed.jpgis encoded as. Two files at the same KB can look different because quality is a quantization choice. - HTMLCanvasElement.toBlob() on MDN — the encode each of the ten probes calls, with a quality argument from 0.10 through 0.95 in this tool.
- ITU-T T.81 — the JPEG specification behind that browser encode.
Related tools
Compress to KB · 100 / 200 / 500 KB attachment caps · HEIC to JPG · WebP to JPG · Verify local