Image Compressor

Compress JPEG, PNG, and WEBP images in your browser. No upload required.

Drop image here or click to upload

JPEG, PNG, WEBP · Max 10MB

This compressor re-encodes a JPEG, PNG, or WEBP through your browser's canvas encoder at a quality you choose, then shows the before/after sizes and the percentage saved. Nothing leaves your machine — the file is decoded, redrawn, and re-encoded locally.

What the quality slider actually controls

For JPEG and WEBP, the slider maps to the lossy quantization strength the canvas encoder uses — lower values discard more detail in exchange for smaller files. For photos, 70-85 is the useful range; below about 60 you start seeing blocking around edges and smearing in gradients. For PNG the slider does nothing at all: PNG is a lossless format and canvas.toBlob ignores the quality argument for it, so this tool passes quality 1 explicitly rather than pretending the knob works. If a PNG needs to get smaller, your real options are converting it to WEBP or JPEG, or cutting its pixel dimensions with the image resizer.

The savings figure can legitimately go negative. Browsers' built-in PNG encoders do not compress as aggressively as offline optimizers, so re-encoding an already-optimized PNG often produces a larger file. When you see a negative percentage, keep the original.

Format handling, and one drag-and-drop quirk

The tool preserves the input format when it can: JPEG stays JPEG, PNG stays PNG (transparency intact), WEBP stays WEBP. Anything else falls back to JPEG output. The file picker only lists the three supported types, but drag-and-drop bypasses that filter — you can drop any image your browser can decode. Drop an animated GIF and you get its first frame re-encoded as a JPEG, with the animation gone. Files over 10 MB are rejected outright.

The download is renamed compressed-<name> with an extension that matches the actual output bytes, so a fallback-to-JPEG conversion never masquerades as a .png. Dimensions are never touched: the canvas redraws at the original width and height, so if the file is large because it is 4000 pixels wide, quality reduction alone will only get you so far.

Questions people ask

Why did my PNG barely shrink, or even grow?

PNG is lossless, so there is no quality dial to turn — the browser just re-runs its own deflate compression, which is usually weaker than whatever produced the original. Convert to WEBP or JPEG if the content tolerates it, or reduce the pixel dimensions instead.

Will compressing twice make the file even smaller?

Marginally at best, and each lossy pass permanently degrades the image — JPEG artifacts compound. Compress once from the best original you have, and keep that original if you might need a different size later.

The image resizer cuts pixel dimensions, which is usually a far bigger size win than lowering quality — a 50% dimension cut removes 75% of the pixels. If you need the result inlined in code, feed it to the file-to-base64 converter.

Further reading