How image compression works here

Four formats, four different encoders, and a rule that you never get back a file bigger than the one you sent.

3 min read

One tool, four encoders

Compression is not one operation. A photograph and a logo fail in completely different ways when you squeeze them, so sending both through the same encoder means one of them comes out wrong. This tool looks at what the file actually is — from its bytes, not its extension — and routes it accordingly.

JPEG → mozjpeg
A progressive encoder that consistently beats the standard one at the same visual quality. On our own test image it produced 1,410 bytes where the default encoder produced 2,435.
PNG → pngquant, then oxipng
First the palette is reduced, then the file is losslessly re-packed. Transparency survives both passes.
GIF → gifsicle
Every frame and the delay between them is preserved, so an animation still animates at the right speed.
SVG → SVGO
Minified as text rather than rasterised. An SVG is a drawing, and turning it into pixels to "compress" it is the bug, not the feature.

You never get a bigger file back

Some images are already as compressed as they are going to get. Run them through an encoder again and the result can be larger than the input — which is the opposite of what you asked for.

So the output is measured against the input, and if compression did not help, you get your original bytes back, untouched. The one exception is SVG, and it is a security exception rather than a size one: the cleaned SVG is always returned even when it is larger, because the original may contain script and the cleaned one does not.

Metadata is removed by default

A photograph from a phone carries the camera model, the settings, and very often the exact GPS coordinates where it was taken. Most people posting a picture do not intend to publish their home address with it.

So stripping that is the default, and it is a checkbox you can switch off when you want the EXIF kept — for a photography portfolio, say, where the settings are part of the point.

The limits

Thirty files per task, fifty megabytes per file, two hundred megabytes per task. Those are enforced as the upload streams rather than trusted from a header, so a client that lies about the size is stopped at the byte that crosses the line.

There is also a cap you will probably never meet: one hundred megapixels. It exists because a small file can decode to an enormous one — a 593 KB PNG in our test set expands to roughly 1.9 GB in memory — and the size is readable in the file header before any of it is decoded.

Frequently asked questions

Will my images look worse?
At the Recommended level, not noticeably. That setting exists to be the point where the file is much smaller and the picture is not visibly different at 100% zoom. Choose Most only when file size matters more to you than fine detail.
How much smaller should I expect?
For a typical photograph, roughly half. It varies a great deal with the picture: a detailed photograph has more to remove than a flat graphic, and a file that has already been compressed hard has very little left.
How long are my files kept?
Two hours, then they are deleted automatically. That is not a policy someone has to remember to apply — the record expires on its own timer and a sweep removes the files it pointed at.