Lean Image
Open menu

Compress JPG images

Every JPG you have has been compressed once already, so the real question is how much room is left in it. Usually more than you think: a photo straight off a phone is written at a setting chosen to be safe rather than small, at around 4,000 pixels wide, for a screen that will show it at a quarter of that. Both of those are yours to change, and you can see the result before you commit to it.

Loading the optimizer…

Nothing is uploaded. Every image stays in this browser tab —here is how that works.

Quality is a ceiling, not a target

If you set a max file size, the encoder does not go hunting for the best quality that fits. It starts at the quality you asked for and only ever comes down.

That is deliberate. A search across the whole range can answer “quality 80, under 500 kB” with a quality 95 file — larger and slower to produce than the thing you actually requested, in the name of a budget it had already met. Here the number you set is the most you will get.

What happens instead is short. It encodes once at your quality; if that fits, you are done, and that is the common case at one pass. If it does not fit, it encodes once more at the very bottom of the scale to find out whether your budget is reachable at all, and only then searches between the two. An impossible target costs two attempts to discover rather than half a dozen wasted ones.

When even the bottom of the scale is too big

Then it stops trading quality and starts trading pixels — shrinking the image about ten percent at a time, up to six steps, re-testing after each. That order is the right way round. A 3,000-pixel-wide photo crushed to the lowest quality looks far worse than the same photo at 1,600 pixels and quality 70, and the two files are about the same size.

If it still cannot reach your number after all of that, you get the smallest thing it could make and a warning saying so. A quietly missed target is worse than a stated one.

The lever most people never touch

Max width. A modern phone photograph is roughly 4,000 pixels across. A full-width image on a website is rarely displayed wider than 1,600, an email attachment needs less, and a forum post less again.

Halving the width and the height leaves a quarter of the pixels, and on a photograph that lands somewhere near a quarter of the bytes — a bigger saving than any quality setting will give you, and one that costs nothing visible if the image was never going to be shown at full size. If you are compressing for the web and have not set a max width, that is the first thing to change.

Which copy of the photo to feed it

Whichever one has been through the fewest hands.

You can usually identify it without much effort: it is the largest file with the biggest pixel count, and on a phone it is still called something like IMG_4021.JPG rather than image0.jpg or photo-1024x768.jpg. Anything that arrived over chat, was saved from a web page, or came out of an export preset has already had a pass applied to it. Compressing that copy works, but you are spending quality that was already spent.

If the original lives in a photo library, export it before you compress — most libraries hand out a re-encoded copy unless you specifically ask for the unmodified original.

What changes when you compress a JPG

  • A second lossy pass compounds the first — Trade-off

    Decoding a lossy image and re-encoding it lossily runs the whole trade again on pixels that already carry artefacts, and the encoder cannot tell the artefacts from the picture — so it spends bits preserving them. One pass at a sensible quality is far better than three at a high one. If you have the original, convert that instead.

  • JPEG opens absolutely everywhere — Benefit

    This is the one format with no compatibility question attached: every browser, every phone, every photo frame, every twenty-year-old print kiosk. If something rejected your file and you are not sure why, JPEG is the answer that ends the conversation.

  • The detail your JPEG already lost stays lost — Note

    A JPEG has been through a lossy encoder at least once already, and the detail that pass discarded is gone from the file — nothing downstream can reconstruct it. Whatever you convert to inherits that starting point, so the honest goal here is to avoid adding a second helping of loss on top, not to recover the first.

  • Camera and location metadata are not carried over — Note

    EXIF is dropped: the camera model, the exposure settings, the timestamp, and — the one that matters — the GPS coordinates of where the photo was taken. That is a privacy improvement for anything you are about to publish and a loss if you were relying on it for cataloguing. Orientation is the exception: it is applied to the pixels, so the image stays the right way up.

  • Output is sRGB — Note

    Everything this tool writes is in sRGB, the colour space the web assumes. That is what makes the result look the same in a browser, a chat app and a photo viewer without an embedded profile to carry around.

Questions people ask about compressing JPG

What quality setting should I use?

Start at 80 and work down, not up. Between 100 and about 85 you are mostly buying bytes rather than detail. Between 80 and 60 the difference is there but you have to go looking for it. Below about 50 the blocking around hard edges becomes obvious. Photographs tolerate lower settings than screenshots, which is why a page of text saved as a JPG falls apart long before a landscape does.

Can I compress to an exact file size?

Yes. Type a number into the max file size box and the encoder finds the highest quality that fits under it, without ever going above the quality you asked for. If even the lowest setting overshoots, it starts reducing the dimensions instead — and if it still cannot reach your number, it tells you rather than handing back something over the limit.

Why did my file barely get smaller?

Because it had already been squeezed. A photo that has been through a messaging app, a website’s image pipeline or another compressor is close to its floor, and pushing harder costs quality faster than it saves kilobytes. On a file like that the dimensions are the only lever with anything left in it.

Will anyone be able to tell?

At quality 80, on a photograph, almost certainly not at normal viewing size. Where it does show is in large flat gradients — a clear sky, a studio backdrop — and around hard edges such as text or a logo laid over the picture. Zoom to 100% and look at those two things specifically before you decide.

Can I do a whole folder at once?

Yes. Drop the lot in and they run several at a time across your processor cores, then come back as a single ZIP. There is no file-count limit, because there is no server to impose one — the practical ceiling is your machine’s memory, not a plan tier.

Related

Other things you can turn a JPG into

Try it with your own file

Drop an image in and see the result before you download anything.