An application form wanted a photo "under 20 KB". I took a decent photo on my phone, opened it in an editor, dragged JPEG quality down to almost nothing, and it was still well over the limit. And it already looked terrible.
The quality slider was the wrong tool for the job. Once I understood why, the fix took a minute.
A JPEG's size is mostly about pixels
A phone photo has millions of pixels. JPEG quality decides how much detail is kept per block of pixels, but every block still costs some bytes, even at the lowest setting. So a 12-megapixel photo at rock-bottom quality can still be far bigger than 20 KB, and it'll look like a mosaic while it gets there.
The form doesn't need millions of pixels. It's going to show your face in a small box on a screen or a printed admit card. The real fix is to make the image smaller in pixels first, then compress.
Rough order of impact:
- Pixel dimensions. Halving the width and height leaves a quarter of the pixels.
- Detail and noise. A grainy photo taken in dim light costs far more bytes than a clean one, because noise is detail as far as JPEG is concerned. A plain light background compresses much better than a busy room.
- Quality setting. This matters, but it's the last knob, not the first.
Also check what "20 KB" means
20 KB is usually 20 × 1024 = 20,480 bytes. Some checks count 1 KB as 1000, which makes it 20,000 bytes. Your file manager rounds, and Windows and macOS don't even round the same way (Windows uses 1024, Finder uses 1000). Look at the exact byte count in file properties before deciding you've passed.
Step by step, with what's already on your computer
1. Crop first. If the form wants a passport-style photo, crop to head and shoulders. Everything you crop away is bytes you don't have to squeeze later.
2. Resize to the pixel size the form asks for. Many notices give a pixel size alongside the KB limit. Use that exactly. If the form gives no pixel size, a few hundred pixels wide is still a clear face on screen. You don't need the phone's full resolution.
- Windows Paint: Resize (Ctrl+W) > Pixels > set the width with "Maintain aspect ratio" ticked > Save as JPEG. Paint gives you no quality control, so you might land over or under.
- Windows Photos (newer versions): the "Resize image" option lets you set pixels and a quality level.
- macOS Preview: Tools > Adjust Size, set pixels. Then File > Export, pick JPEG, and move the Quality slider. Preview shows the estimated file size under the slider, which is handy for this.
3. Then compress, and check the bytes. If you're a little over, nudge quality down. If you're way over, go back and resize smaller.
This works. It's also fiddly, because you're guessing a pixel size, saving, checking, and repeating.
Letting a search do the guessing
Hitting an exact byte target is really a search problem: try a quality, check the size, try again, and if even the lowest sensible quality is too big, shrink the pixels and search again. I got tired of doing that by hand, so I built a compress-to-20 KB page that runs the search in the browser. (Disclosure: I make ToolOcean.) The photo never leaves your device.
What it does:
- Opens with a 20 KB ceiling (20,480 bytes) and writes JPEG by default, or WebP if you switch.
- Searches JPEG quality, and if quality alone can't fit, scales the pixels down and searches again.
- Tells you what it landed on: final bytes, and whether it's within the target.
The page shows its own test run so you can see the behaviour: a 1200 × 800 image of pure noise (a worst case for JPEG) had to be scaled to 900 × 600 at a very low quality to land at 20,387 bytes. A normal portrait with a plain background usually survives much better than noise.
A few honest limits:
- HEIC isn't decoded. iPhone photos in HEIC need converting to JPEG first. Or set the camera to save JPEG: Settings > Camera > Formats > Most Compatible.
- Transparency gets painted white. A PNG signature with a transparent background becomes a JPEG on white, which is what forms want anyway.
- At 20 KB a photo won't stay sharp. Fine detail goes first. If your face looks smeared, crop tighter and resize to the form's exact pixel size before running it, so the bytes go to your face and not the wall behind you.
Things that get photos rejected even under 20 KB
- Wrong pixel size. Some forms check dimensions as well as KB. Under 20 KB at the wrong size can still fail.
- A PNG renamed to .jpg. Renaming doesn't convert anything, and some validators check the real format. Re-save it as an actual JPEG.
- Too small. Some forms set a minimum too, like "between 10 and 20 KB". Squeezing too hard fails the other way. (I'll cover hitting a range in a separate post.)
The gotcha
If the portal rejects a file that's 20,300 bytes, it's probably counting 1 KB as 1000 bytes, so its limit is 20,000. Don't fight it. Set a custom ceiling of 19 KB and run it again. The page has a custom size box for that.
Drafted with AI help, tested and checked by me.
Top comments (0)