Images
Image Compressor — JPEG, PNG & WebP
Compress JPEG, PNG, or WebP images in your browser — batch multiple files, compare before/after, download as a zip.
Runs entirely in your browser — nothing you paste is uploaded or stored.
What is image compressor?
This tool shrinks one or many images' file size by re-encoding them through the browser's own Canvas API — the same decoder and encoder a browser already uses to display images, run entirely on your device. Drop in a whole batch at once, choose an output format, drag a quality slider for JPEG or WebP, and optionally cap the longest side in pixels to downscale a photo that's larger than it needs to be. PNG output defaults to a lossless pass from a real PNG optimizer (Oxipng, running via WebAssembly) on top of the canvas encoder, since a generic deflate pass alone leaves real savings on the table — or switch PNG to an optional Lossy mode for much larger savings via color-palette reduction, the same family of technique as the classic pngquant tool, trading some visual fidelity for a much smaller file. Each image gets a draggable before/after comparison and its own size stats, and finished images download individually or all at once as a zip — the originals are never modified or uploaded anywhere.
When to use it
- Shrinking a phone photo before attaching it to an email or uploading it to a site with a size limit.
- Converting a batch of PNG screenshots to JPEG or WebP to cut file size for a blog post or documentation page.
- Resizing a set of oversized product photos down to the dimensions a website actually needs, all in one pass.
- Dragging the before/after slider to check quality holds up before committing to a lower setting.
- Reducing page weight for a personal site or portfolio without a build pipeline or image CDN.
How to use this tool
- Drop one or many image files in, or choose them from your device.
- Pick an output format — JPEG or WebP for a quality-adjustable, usually much smaller file, or PNG to keep it lossless.
- For PNG, optionally switch to Lossy mode and drag the same slider to trade fidelity for a much smaller file.
- Drag the quality slider and watch each image's size update.
- Optionally set a maximum dimension to downscale every image in the batch.
- Drag the before/after slider on any image to check quality, then download it individually or grab the whole batch as a zip.
Example
A generated sample image compressed from PNG to JPEG.
Input
A 640×640 PNG gradient image.Output
The same image re-encoded as JPEG at 80% quality, typically 80-95% smaller.Press "Load example" to generate a real sample image and see the actual size reduction for yourself.
Choosing quality and dimensions
A quality of 70-85% is usually visually indistinguishable from the original for JPEG and WebP while cutting file size dramatically — go lower only for thumbnails or previews where some visible compression is acceptable. Downscaling with the max-dimension option is often the single biggest lever: an image twice as wide and twice as tall as it needs to be has roughly four times the pixel data to encode, regardless of quality setting.
What powers compression and downloads
JPEG, WebP, and the baseline PNG pass all use the browser’s own Canvas API. The lossless PNG
pass runs @jsquash/oxipng (Apache-2.0 licensed),
a WebAssembly build of the Oxipng optimizer. PNG’s optional Lossy mode instead uses
image-q (MIT licensed), a pure
JavaScript color-quantization library implementing the same family of technique as the
classic pngquant tool. The “download all as zip” option is built with
fflate (MIT licensed), a small, fast zip
implementation. All three run entirely in your browser.
Frequently asked questions
Does this upload my photo anywhere?
No. Decoding, resizing, and re-encoding all happen in your browser using the Canvas API — the same code path a browser already uses to display an image on screen. Nothing you choose is ever sent to a server, which is true of every tool on this site.
How much smaller does PNG output actually get?
In the default Lossless mode, no pixel is ever changed — but the file does still shrink. After the browser's own canvas encoder produces a baseline PNG, this tool runs it through Oxipng (a dedicated PNG optimizer, compiled to WebAssembly and running entirely in your browser) for a genuinely better compression pass, the same technique this site's own build pipeline uses on its images. Typical savings run 10-30% on top of the canvas encoder's output, depending on the image. For much bigger savings, switch to the optional Lossy mode, which reduces the image to a smaller color palette (the same family of technique as the classic pngquant tool) before encoding — often 50-70% smaller or more, at the cost of a real, visible quality trade-off — gradients and photos can show banding at aggressive settings, though flat-color graphics like icons and UI screenshots usually hold up well even with very few colors. If a smaller file matters more than staying lossless, JPEG or WebP at a lower quality will still produce a much bigger reduction than lossless PNG; WebP also supports transparency, so it's a good lossy alternative to PNG when an image has an alpha channel.
Should I pick JPEG or WebP?
WebP is supported by every modern browser and typically produces a smaller file than JPEG at the same visual quality, plus it supports transparency, which JPEG doesn't. JPEG remains the safer choice if the image needs to work in very old software or a context that doesn't recognize WebP at all — for a modern website, WebP is usually the better default.
Why doesn't this tool accept GIF files?
A GIF can be animated, and this tool's canvas-based re-encoding only ever captures a single frame — accepting an animated GIF would silently flatten it into a still image with no warning, which is a worse outcome than simply not supporting the format. Compressing an animated GIF properly needs a different, frame-aware tool.
What's the largest image this will handle?
Files up to 25 MB each. Decoding and re-encoding both happen synchronously in your browser tab, so a much larger file risks becoming unresponsive rather than failing gracefully — resize a very large image with a desktop tool first if you hit this limit.
Can I compress a batch of images at once?
Yes — drop or choose as many images as you like (up to 30 in one batch) and every image compresses with the same format, quality, and resize settings. Each finishes independently with its own before/after comparison, and you can download one at a time or grab the whole finished batch as a single .zip file.
Find these tools useful? A coffee helps keep them free and ad-light.
Buy me a coffee