Image compressor
Shrink PNG, JPEG and WebP images in the browser: pick a quality, or enter a target size and let the tool search for the best quality that fits. Everything stays local.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Choose an image
Compression runs through Canvas in the browser — the image is never uploaded.
PNG / JPEG / WebP input is supported; the output can be JPEG, WebP or PNG.
Result
Pick an image, set the options, then press Compress.
What this tool does
- A 5 MB screenshot has to fit a 2 MB upload limit — switch to target size, ask for 500 KB, and the tool finds the highest quality that still fits.
- Make store images open instantly on mobile: stay in quality mode, try 60–80% and check the side-by-side preview before you commit.
- Convert PNG screenshots to WebP, usually cutting the file by half or more while keeping transparency.
- Calibrate a batch job on a single image: find the quality and size that work, then reuse those numbers everywhere.
Example
Input
A 4 × 4 PNG, output format JPEG, mode "Set quality" at 70%
Output
Produces graphic-compressed.jpg and shows original size, output size and the size-change percentage, with 70% as the quality actually used
PNG output is lossless so the quality slider has no effect — pick JPEG or WebP when you actually need a smaller file.
Frequently asked questions
How does the target-size search work?
It really encodes the image at 90%, 80%, 70% … 20% from high to low and keeps the first step that fits the target (a 5% overshoot is allowed), stopping as soon as it fits so no pointless encodes happen. If every step overshoots, it falls back to the smallest one (20%) and tells you the target was missed.
Why did the output get bigger?
Two usual causes: re-encoding an already-compressed JPEG at a very high quality, or converting a colour photo to PNG. The result panel flags "Output is larger than the original"; dropping below 60% or switching to WebP normally fixes it.
How much quality do I lose?
JPEG and WebP are lossy, so lower quality means more blocking and softer edges. 70–80% is usually indistinguishable to the eye, while below 60% you start seeing artefacts in gradients and around text. The side-by-side preview is there so you can judge it yourself.
Is my image uploaded anywhere?
No. Compression uses the browser’s own Canvas encoder (canvas.toBlob) and makes no network requests at all, so the image never leaves local memory and disappears when you close the tab.
Are EXIF and transparency preserved?
EXIF is not preserved at all — re-encoding through Canvas drops shooting parameters and GPS, which is good for privacy. For transparency: JPEG cannot store it and the transparent areas become black, while WebP and PNG keep the alpha channel.
Keywords:图片压缩照片压缩image compressorcompress imagejpeg 质量webp 压缩目标体积canvas toblob减小图片体积压缩比