Image Compressor
Compress JPEG, PNG, and WebP images in your browser. Adjust quality, resize on the long edge, and shrink file size — runs in your browser, no upload.
- Runs in your browser
- Your data never leaves your browser
- Free · No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
Quality vs File Size
Quality controls the lossy compression rate for JPEG and WebP outputs. Numbers above 90 produce nearly transparent compression — file size stays high. Numbers below 60 introduce visible artefacts on smooth gradients and skin tones. The tool starts at 75 as a middle setting; compare the preview with the original before you settle on a lower value.
Example: A Web Page Screenshot
A 1366×900 PNG screenshot of a web page (140.3 KB, taken in Chromium) at the default quality 75:
- Keep original (PNG): 197.7 KB, +41.0%. The browser’s PNG encoder compresses less tightly than the tool that wrote the original, so re-encoding a PNG can make it larger. Keep the original file in that case.
- WebP: 42.6 KB, −69.6%.
- JPEG: 87.0 KB, −38.0%. Text edges in screenshots show JPEG ringing sooner than photos do; WebP is the better target for UI captures.
Format Cheat Sheet
- JPEG — photographs, hero shots, anything with continuous tonal gradients. No transparency.
- PNG — UI screenshots, diagrams, anything with hard edges or transparency. Lossless.
- WebP — modern browsers everywhere; usually 25–35% smaller than JPEG or PNG at equal quality. Supports transparency.
- Keep original — useful when you just want to resize without converting formats.
Resize the Long Edge
Most web layouts max out around 1920 pixels wide. Retina (2× DPR) screens benefit from 2560–3840. When you set the long edge limit, the tool scales the shorter edge proportionally so aspect ratio is preserved. For thumbnails or social previews, try 1024 or 1440 px on the long edge.
Privacy: Nothing Is Uploaded
This tool uses createImageBitmap and the Canvas 2D API to decode and re-encode images in your browser.
The compressed file is constructed locally by canvas.convertToBlob (or canvas.toBlob as a fallback) and served to you via a temporary blob URL.
There is no server endpoint involved — try it in airplane mode if you want to confirm.
Limits
- Maximum 50 MB per file (mobile browsers run out of memory on much larger inputs).
- Animated GIFs are flattened to the first frame by design — for animated GIF re-encoding, use
ffmpeglocally. - EXIF orientation is auto-applied: photos taken sideways come out the right way up.
- Re-encoding through a canvas drops all metadata: EXIF (including GPS location), XMP and the ICC color profile. Removing GPS is often what you want before sharing a photo; losing a Display P3 or Adobe RGB profile can make saturated colors look duller.
- Transparent areas become white when the output is JPEG.
- If the browser has no encoder for the chosen output format, the HTML standard makes the canvas produce PNG instead. The tool then names the file
.pngand shows a note under the result. A GIF with Keep original always comes out as PNG, because browsers cannot encode GIF from a canvas.
Related Tools
- WebP Converter — when you specifically need PNG/JPG ⇄ WebP conversion with a simpler UI.
- SVG Optimizer — vector images cannot be raster-compressed; optimize SVG source instead.
- Image to Base64 — when you need to inline an image as a data URL.
FAQ
Are my images uploaded anywhere?
No. Every byte stays in your browser. The compression runs on Canvas 2D APIs locally, and the output file is created by your browser. ZeroTool never sees your images.
Which formats does it support?
Input: JPEG, PNG, WebP, and single-frame GIF (animated GIFs are flattened to the first frame by design). Output: JPEG, PNG, or WebP. For HEIC, TIFF, or RAW, use a local tool such as exiftool or ImageMagick — browsers cannot decode these formats. For SVG, use our SVG Optimizer instead.
Why is the quality slider disabled for PNG?
PNG is a lossless format — browsers do not accept a quality parameter when encoding PNG. To shrink a PNG with this tool, either resize its long edge or convert the output to JPEG / WebP. For deeper lossless PNG optimization, run a dedicated tool such as oxipng locally.
Why is my output sometimes larger than the input?
Re-encoding an already optimized image can grow it, especially when you switch a PNG screenshot to high-quality JPEG. The tool flags this with a red percentage so you can drop the larger output and keep the original.
Is there a file size limit?
Yes — 50 MB per file, to protect mobile browsers from running out of memory. There is no limit on total batch size, but very large batches will be slower.