I picked a 1.8 MB PNG from my phone, typed 100 into a box labelled target size, and tapped Compress. Two seconds later the page told me the file was down to 100 KB. 1764 KB to 100 KB, 94% smaller, picture still recognizable.
I’d like to say I was impressed with myself. Mostly I was annoyed that the usual way of doing this job is so much worse.
Here is how it normally goes. Some portal, form or email system says maximum 100 KB. You search for a compressor and land on a page that is mostly ads. You upload your file to a server you know nothing about, wait for a progress bar, and download a result that is 140 KB because the site squeezed by a fixed amount and not to your limit. Then you go around again.
The part I stopped tolerating is the upload. The files that run into size limits are rarely holiday photos. They’re passport-style pictures, scanned documents, signatures, screenshots of things you’d rather keep private. Handing those to a stranger’s server so it can make them smaller is a strange trade, and “we delete files after an hour” is a sentence you can’t check.
So this post covers how to get an image under a size limit without the file ever leaving your device, what the controls actually do, and where the whole thing breaks. Everything here comes from runs I did myself, so the numbers are small and real, not a benchmark chart.
What the quality number actually is #
The quality setting on a JPEG isn’t a percentage of anything. An image at quality 80 isn’t 80% of the original file size, and it isn’t 80% as sharp either. What happens is this: the encoder cuts the image into 8 by 8 pixel blocks, converts each block into a set of patterns running from broad shapes down to fine detail, and then rounds the numbers. The quality setting decides how hard it rounds. Light rounding keeps nearly everything, so the file stays large. Heavy rounding throws away the fine-detail patterns first, and the file shrinks.
That’s why the damage looks the way it does. Push quality low and you get blocky smudges, and the worst of it lands on sharp edges like text and thin lines, where the fine patterns were doing real work. Photos hide it far better, because natural texture covers for the rounding.
It also means the number isn’t portable. Two programs can both say 80 and produce different files, because each one has its own table for how hard to round. Treat it as a dial on one tool, not as a unit.
Aiming for a size instead of a quality #
Size limits are written in kilobytes. The only dial you get is quality. You can’t convert one into the other in your head, because the answer depends on the image: the same quality setting gives wildly different file sizes on a flat-color graphic and on a busy photo.
So the tool does what you’d do by hand, only faster. It tries a quality in the middle of the range, checks the size of the result, and moves. Too big, go lower. Fits, try higher and see if it still fits. About seven attempts cover the whole range, which is why the job takes two seconds and not twenty minutes of me dragging a slider.
your file (stays on your device)
|
v
browser memory
|
v
try a quality, check the size
too big -> go lower
fits -> go higher
|
v
best result that fits the limit
|
v
preview + download linkEverything in that loop happens inside the browser tab. The file is read into memory, squeezed there, and handed back to you as a download link. There’s no step where it goes anywhere else, which is the whole point.
What my four test runs showed #
I ran four images through it on my phone. Here’s what came back.
| Run | Original | Setting | Result |
|---|---|---|---|
| PNG image | 841 KB | quality 40 | 37 KB (96% smaller) |
| JPEG photo | 502 KB | target 500 KB | 499 KB (1% smaller) |
| PNG graphic | 1764 KB | target 100 KB | 100 KB (94% smaller) |
| PNG graphic | 1835 KB | target 50 KB | 66 KB (96% smaller), target missed |
The first row predates a unit change I’ll get to below, so its sizes use 1,024-byte kilobytes. The percentage doesn’t care. The later runs each took about two seconds.
Look at that first row. The PNG went from 841 KB to 37 KB at quality 40. PNG stores every pixel exactly, which makes it the heavy format. Converting to JPEG means accepting a little loss, and for images with big flat areas the loss is cheap. That’s where the 96% comes from. It isn’t magic, and it won’t repeat on every file.
Row two is the opposite case. The photo was already a JPEG at 502 KB, I asked for 500, and I got 499. The tool did what I asked, barely, because a file that has already been compressed has little slack at that target. Ask for a much smaller number and it has to cut real quality, which is the trade you’re making whether you notice it or not.
Row three is the one I’d use as the template: a big PNG, a target of 100 KB, and the result landed right on it.
Row four is the failure, and I’m glad it’s in the table. I asked for 50 KB and got 66 KB. The page said plainly that it couldn’t reach the target and gave me the smallest it could manage at the lowest quality it allows. I’ll take an honest miss over a tool that hands you 66 KB and lets you find out at the upload screen.
Here’s why it missed. Quality only controls the rounding. It doesn’t change how many pixels there are. When quality bottoms out and the file is still too big, the only lever left is the pixel count. Halve the width and the height and you’re down to a quarter of the pixels, which usually means a much smaller file. Shrink the image first, then compress.
I’ve since taught the tool to handle this case on its own. When the target can’t be reached at the lowest quality, it shrinks the image and tries again, and it tells you the new size. A 3000 by 2000 photo went to 2248 by 1498 pixels to land on 80 KB.
Kilobytes are not all the same size #
My phone’s gallery said one of my test photos was 502 kB. My tool said 490 KB. Same file. The gallery counts a kilobyte as 1,000 bytes, and my tool was dividing by 1,024. 502 times 1,000 divided by 1,024 is about 490, which is exactly what I saw. I changed the tool to use 1,000 so its numbers match what phones show, but portals pick whichever convention they like, and they rarely say which.
So leave margin. If the limit is 100 KB, ask for 95. A 95,000-byte file passes whether the portal counts 1,000 or 1,024, and the five KB of quality you gave up is quality you’d never see.
Things that go wrong #
Transparent PNGs. JPEG can’t store transparency, so the see-through areas have to become some color. Many tools quietly pick black, and your logo shows up on a black rectangle. The tool I use paints a white background first, then compresses. If you need the transparency to survive, stay with PNG and shrink the dimensions instead.
Compressing a compressed file. Every JPEG save loses a little more. Always work from the original, and don’t feed the output back in to get a bit smaller. Do it once, aimed at the final target.
Text in screenshots. Low quality smears small text. If the image has words you need to read, keep quality at 70 or higher as a rule of thumb, and resize instead.
Rotated phone photos. Phones often store the rotation as a hidden flag inside the file, and re-encoding can drop it. Glance at the preview before you upload the result anywhere. The same goes for location data: re-encoding usually strips what the camera wrote into the file. That’s a side effect, not a promise.
How to do it yourself in about a minute #
- Open my image compressor in any browser. A phone is fine.
- Tap the dashed box and pick your image. The page shows the original size right away.
- Type your limit, minus a few KB, into the target size box. Leave it empty if you’d rather use the quality slider.
- Tap Compress. You get a preview, the before and after sizes, and the time it took.
- Zoom into the preview. If text looks smeared, aim a bit higher or resize first.
- Rename the file in the Save as box if you want, then tap Download.
That’s the whole trick. One box, a few attempts, two seconds, and the picture never left the phone. The progress bar on the other site can keep spinning without me.