How this compressor hits a size target
Pick the size you need and your browser works out the rest. No single JPEG quality setting produces a 100 KB file: the same setting gives you 40 KB on a flat logo and 900 KB on a beach photo. So the tool searches. It encodes at the top quality, then at the bottom, then bisects between them and keeps the highest quality that fits under your ceiling. Eight encodes per resolution, two dozen for the whole job, all of it on your device through the Canvas API.
When even the lowest quality overshoots, the tool cuts the pixel count and searches again, and it keeps cutting until the bytes fit or the picture reaches a tenth of its longest side. A 5000x4000 photo weighing 29 MB came back at 18 KB and 1610 pixels wide against the 20 KB preset, in about a second and a half. At 200 KB it kept all 5000 pixels.
What you get back
JPEG, whatever you put in. A byte ceiling needs a lossy encoder, and PNG has no quality dial to turn. JPEG is also the format that upload forms with size limits accept. Transparent areas in a PNG or WebP come out white, since JPEG carries no alpha channel. The re-encode drops camera metadata, so EXIF fields like the lens and the GPS coordinates are gone.
Sometimes the file comes back untouched, under its own name and format. Your image was already under the target, and re-encoding it would strip detail to save you nothing.
How close it gets, and when it misses
Your number is a ceiling the search aims at rather than a promise. Against that 29 MB photo the five presets landed between 89% and 98% of the ceiling. To miss, a picture has to be too heavy for your number even at a tenth of its longest side: a 46 MB block of pure noise still cleared 20 KB, at 497 pixels wide. On a miss you keep the smallest file the search made, with its real size in the row, instead of an error and nothing to upload.
Frequently asked questions
Does KB mean 1000 or 1024 bytes?
- A 100 KB target means 102,400 bytes, and every size on the page uses the same arithmetic.
Can I compress a PNG and get a PNG back?
No. Every output is a JPEG, and lossless PNG optimization is a different job this tool does not do.
Which formats can I feed it?
JPEG, PNG and WebP. Hand it a GIF, a BMP or a HEIC and it refuses, at the dropzone or at the byte check behind it.
Does running it twice help?
No. A file already under your target comes back untouched, so a second run at the same number changes nothing. A lower number does work, and it costs detail you cannot get back.
How many images at once, and how big?
As many as you drop, up to 50 MB each. Every image gets a download button, plus one that zips the lot.