MrPositive

Explainer

Why 20 KB is so hard, and what file size limits actually mean

A file size limit sounds simple until your photo needs to lose 99 per cent of its size. Here is what is actually happening.

What a kilobyte actually is

A kilobyte is usually 1024 bytes, because it grew out of computing conventions based on powers of two. But storage manufacturers, and some web portals, use 1000.

That 2.4 per cent difference sounds trivial until a portal rejects a file sitting exactly on the limit. If your file is within a few kilobytes of the ceiling, this disagreement alone can be the reason.

The practical fix is to leave a margin. Aim for about 90 per cent of the stated limit rather than the limit itself.

Why a phone photo is so far over

A modern phone camera produces a photograph of roughly 4000 by 3000 pixels. That is 12 million pixels, each stored as three colour values.

Before compression that is around 36 megabytes of raw data. The phone writes it as a JPEG of 3 to 8 megabytes, which is already a compression ratio of about ten to one.

A 20 KB limit is asking for roughly 1800 to one. Something has to give, and what gives is pixels and fine detail.

The two levers, and what each costs you

There are only two ways to make a JPEG smaller.

The first is fewer pixels. Reducing the dimensions reduces the file roughly in proportion to the area, so halving both width and height cuts the data to a quarter. This costs you the ability to render the image large.

The second is stronger compression. The encoder discards progressively finer detail, which costs you subtlety — texture, gradients and clean edges.

For an identity photo, reducing pixels is nearly free: the reviewer needs to recognise a face, not print a poster. Strong compression is what makes a photo look muddy, which is why the sensible order is to reduce dimensions first and compress only as much as necessary afterwards.

Why a plain background saves so much space

Compression spends its bytes on variation. A plain wall is nearly uniform, so it costs almost nothing to encode. A patterned curtain behind you is thousands of small variations, and every one of them competes for the same 20 KB as your face.

The same logic applies to noise. Photographs taken in poor light carry sensor noise across the whole frame, and noise is variation, so it is expensive. Good light is not just a nicety — it directly reduces the file size you need.

Why the result is not always exactly the limit

JPEG has no setting for "exactly 20 kilobytes". Compressing the same image at a slightly different quality can produce a large jump in size, and the relationship is not smooth.

That is why a good tool searches for the setting rather than guessing once. It looks for the highest quality that still fits underneath your ceiling, and if that is not enough, it reduces the dimensions and tries again.

The outcome you want is the largest file that still passes, because that is the sharpest one.

Questions people ask

Is 20 KB enough for a usable photo?

For an identity photo, yes. At that size the image is a few hundred pixels wide, which is more than enough for someone to confirm a face matches. It is not suitable for printing.

Why does my file show as 19 KB on one device and 20 KB on another?

Usually a 1000-versus-1024 difference in how a kilobyte is counted, or rounding. Leave a margin so this cannot matter.

Does compressing the same photo twice make it much worse?

It degrades faster than people expect, because each pass discards detail again from an image that already lost some. Always compress from the original.

Why did my photo get blurry when I made it smaller?

Strong compression softens fine detail. Starting from a larger, well-lit original with a plain background gives the encoder far less work to do, and the result stays noticeably sharper.