Image Compressor
Shrink JPEG, PNG and WebP images without uploading them anywhere. Drag in a batch, set a quality and a maximum size, and download the results.
Drop images here
JPEG, PNG, WebP or GIF — several at once is fine.
How this compressor works
When you drop a file in, the browser reads it into memory with the File API and decodes it with
createImageBitmap. The decoded image is drawn onto a
<canvas> — scaled down first if you asked for a maximum dimension — and then
re-encoded by canvas.toBlob() using the format and quality you chose. The result is
a brand-new file that exists only in your browser tab until you download it. No byte of your
photo is transmitted anywhere.
That also explains why the outcome depends on your device. Each browser ships its own JPEG and WebP encoders, so the same source file at the same quality setting can come out a few percent larger or smaller on Chrome than on Safari, and a 75 % quality JPEG from one engine is not bit-identical to a 75 % quality JPEG from another. The number in the quality box is an input to an encoder, not a guarantee about the output.
Choosing a format
| Format | Best for | Watch out for |
|---|---|---|
| JPEG | Photographs, gradients, anything with millions of colours | No transparency; blurs text and sharp edges first |
| WebP | Both photographs and graphics; supports transparency | Very old browsers and some desktop applications cannot open it |
| PNG | Screenshots, logos, icons, line art, anything with transparency | Lossless, so photographs stay large; the quality slider has no effect |
What you are giving up
Compression is lossy and irreversible. Once a photograph has been saved at 60 % quality, the discarded detail is gone; re-saving it later does not bring it back, and editing and re-encoding the same file repeatedly compounds the damage. If an image matters, keep the original somewhere safe and compress a copy.
Resizing is even more decisive. Pixels that are thrown away cannot be recovered by enlarging the result — you get a bigger file with the same amount of detail, plus interpolation blur. For the web, the most effective single thing you can do is resize an image to the largest size it will actually be displayed at, and only then compress it.
A realistic workflow: keep the camera original, export a copy at 1600–2000 px on the longest side, compress that copy at 75–80 % as WebP or JPEG, and check the result at 100 % zoom on the areas with the most detail — faces, text and fine texture.
Frequently asked questions
Are my photos uploaded to a server?
No. The file is read with the browser's File API, drawn onto a canvas and re-encoded by your own device. Nothing crosses the network. You can prove it by opening your browser's network panel while compressing — there will be no upload request — or by disconnecting from the internet after the page has loaded, which changes nothing.
Why did my PNG get larger when I compressed it?
The quality slider only applies to lossy formats (JPEG and WebP). A PNG is re-encoded losslessly, so it cannot be told to 'try harder'. If a PNG becomes bigger it is usually because the original was already optimised with a specialised tool, or because it was a photograph — photographs compress far better as JPEG or WebP than as PNG.
What quality setting should I use?
For photographs on the web, 70–80 is usually indistinguishable from the original at normal viewing size while cutting the file size dramatically. Below about 60 you start to see blocking around sharp edges and banding in smooth gradients such as skies. For images with text, screenshots or line art, keep the quality high or use PNG, because lossy formats blur hard edges first.
Does resizing lose more quality than compressing?
They are different operations. Resizing discards pixels permanently, so the image can never be enlarged back to its original detail. Compressing re-encodes the existing pixels with less precision. If you need a smaller file for the web, doing both — resizing to the largest size you will actually display, then compressing — is far more effective than either alone.
Sources & further reading
- MDN — Canvas API — the drawing surface used to re-encode every image here
- MDN — HTMLCanvasElement.toBlob() — the call that performs the actual format conversion and quality setting
- web.dev — Serve responsive images — why resizing to the displayed size saves more than compression alone