ZYSNOR, smart solutions, real impact
Image Compressor

Images guide

How to reduce a photo to a size in KB

By , Founder of ZYSNOR · Updated · Checked · 15 min read

In short

A photo's file size is roughly width × height × bits per pixel ÷ 8. To fit a limit, lower the quality setting first, and shrink the pixel size only if quality alone is not enough. For a 4:3 photo, a 50 KB limit (50,000 bytes) allows about 400,000 pixels at 1 bit per pixel, which is roughly 730 × 548. Aim under the limit in bytes, because some programs count a KB as 1,024 bytes and others as 1,000.

Jump to a section

Problem 5. A 2,400 × 1,600 photo must be at most 200 kB (1 kB = 1,000 bytes). What is the budget in bits per pixel at full size, and what size would give about 1 bit per pixel?

Show the worked answer

Pixels = 2,400 × 1,600 = 3,840,000. Budget = 200,000 × 8 ÷ 3,840,000 = 0.42 bits per pixel, which is low. For 1 bit per pixel the picture needs 200,000 × 8 = 1,600,000 pixels. The scale factor is √(1,600,000 ÷ 3,840,000) = 0.645, giving about 1,549 × 1,033. This is the same method as Problem 4 and a planning estimate, not a measured result.

The form says the photo must be no larger than 100 KB, and the picture on your phone is 3 MB. This guide explains what actually makes a photo file big, what each control does to it, and how to reach a limit with the least damage to the picture. Every claim about numbers comes from a measurement we ran or a source we read, and we say which.

What "KB" means on a form

The metric prefix kilo means 1,000, so a kilobyte (kB) is 1,000 bytes. Computing also uses 1,024-byte units, which the International Electrotechnical Commission named the kibibyte (KiB) in 1998; NIST lists both and notes that the binary prefixes are not part of the SI. In everyday use the label "KB" gets applied to either. A form rarely says which it means.

The safe habit is to aim for fewer than 1,000 bytes per KB of the limit. The ZYSNOR tool does this: it multiplies your limit by 1,000, so a 100 KB limit means the file must be at most 100,000 bytes. That is also below 102,400 bytes, so it passes under either meaning.

Example 1. A file of 101,000 bytes is 101.0 kB, which breaks a strict 100 kB limit. A program that counts 1,024 bytes per KB would show it as 101,000 ÷ 1,024 = 98.6 KB and make it look fine. The form's own checker decides, so leave a margin.

Two numbers decide the size

A photo is a grid of pixels. Each pixel needs some number of bits once the picture is compressed, and bits per pixel (bpp) is the number that links the picture to the file:

bytes ≈ width × height × bpp ÷ 8

Take our coffee photo, 600 × 400 pixels, which is 240,000 pixels. Stored as raw 24-bit colour it needs 240,000 × 3 = 720,000 bytes. The lossless PNG version of the same photo is 461,327 bytes. A JPEG saved at high quality (Pillow quality 95) is 104,711 bytes, about 3.5 bits per pixel. The ZYSNOR tool at a 30 KB limit gave 29,585 bytes, and 29,585 × 8 ÷ 240,000 = 0.99 bits per pixel. So the formula works in both directions: the limit fixes the bits you can spend, and the bits spread over the pixels you keep.

How JPEG makes a photo smaller

JPEG stands for Joint Photographic Experts Group. The group was formed in 1986 to write a standard for continuous-tone still images, grey or colour. Gregory Wallace of Digital Equipment Corporation described the result in the April 1991 issue of Communications of the ACM, and ITU-T Recommendation T.81 was approved on 18 September 1992; ISO publishes the identical text as ISO/IEC 10918-1.

The common mode, called baseline, works in four steps:

  1. Blocks. The picture is cut into 8 × 8 squares of pixels.
  2. Transform. Each block goes through a discrete cosine transform (DCT), which re-describes the 64 pixels as 64 waves of different fineness. Nothing is lost here; the same picture is written differently.
  3. Quantization. Each of the 64 wave strengths is divided by a step size from a table and rounded to a whole number. Wallace calls this the principal source of loss. Fine waves are the ones that get rounded to zero first, which is why detail like skin texture and fabric goes before the big shapes.
  4. Entropy coding. The rounded numbers, now full of repeated zeros, are packed into a short bit string without further loss.
Four boxes: cut into 8 by 8 blocks, transform with the DCT, quantize which loses detail, then pack the bits without loss
Only step 3 throws information away. A lower quality setting makes step 3 coarser.

This explains the controls. A quality setting is a dial on step 3: low quality means big step sizes, many zeros, a short bit string and a small file. Pixel count is a dial on step 1: fewer blocks, fewer bits. Everything else is packaging.

One detail matters for every tool: the standard does not define a quality scale. T.81 states that no default quantization tables are specified and that applications may set values to customise picture quality. The browser documentation says the same thing from the other side: the canvas quality value is a number from 0 to 1, but how that number maps to size or looks is left to the browser. So "quality 80" in one program is not "quality 80" in another, and two tools can give different sizes for the same setting.

What the quality number does

We encoded the same 600 × 400 coffee photo in Chromium 153 at eleven quality values, and again after shrinking it to 300 × 200 and 150 × 100 pixels.

Chart of file size in kilobytes against JPEG quality for three pixel sizes; the 600 by 400 line falls from 93 KB at quality 0.94 to 9 KB at 0.12
The curve is steep near the top: going from 0.94 to 0.8 roughly halves the file.
Quality value600 × 400300 × 200150 × 100
0.9493,353 B27,716 B8,934 B
0.8047,757 B14,729 B5,043 B
0.5026,836 B8,578 B3,214 B
0.129,282 B3,370 B1,648 B

Read it as a rule of thumb for this one photo. The top of the range is expensive: moving from 0.94 to 0.80 saved about half the bytes (93,353 down to 47,757) for a drop most people would not notice on a small screen. Below 0.5 the savings shrink while the picture gets blocky. That is why a tool that wants the best picture under a limit should use the highest quality that still fits, not the lowest.

What the pixel count does

Halving the width and the height leaves a quarter of the pixels, so you might expect a quarter of the bytes. It is not quite so. At quality 0.8 the 600 × 400 file is 47,757 bytes and the 300 × 200 file is 14,729, a ratio of 0.31, not 0.25. At 150 × 100, with one sixteenth of the pixels, the file is 5,043 bytes, a ratio of 0.11, not 0.06. The reason is that a small version of a photo packs the same objects into fewer pixels, so each pixel carries more change and needs more bits. Shrinking is effective, but you get less than the pixel arithmetic suggests.

Worked examples

Example 2: how many pixels fit in 50 KB? A 50 KB limit is 50,000 bytes, which is 400,000 bits. At 1.0 bit per pixel that pays for 400,000 pixels. For a 4:3 photo, width = √(400,000 × 4 ÷ 3) = 730 and height = 400,000 ÷ 730 ≈ 548. So about 730 × 548 pixels at about 1 bit per pixel. If you accept 0.66 bits per pixel (the level we measured at a 20 KB limit), 400,000 bits pay for 606,061 pixels, which is about 899 × 674.

The same arithmetic for the common limits, at 1.0 bit per pixel and a 4:3 shape:

LimitBytesPixels at 1.0 bppSize at 4:3
20 KB20,000160,000462 × 346
50 KB50,000400,000730 × 548
100 KB100,000800,0001,033 × 775
200 KB200,0001,600,0001,461 × 1,095

This is a planning table, not a rule: 1 bit per pixel gave a similarity score around 0.89 to 0.94 on our test photos (section 7), which looks good on a screen but is not lossless. Busier photos need more bits per pixel for the same look; smooth photos need fewer.

Example 3: a phone photo to 100 KB. A 12-megapixel phone photo is 4,000 × 3,000 pixels. A 100 KB limit is 800,000 bits, so the budget is 800,000 ÷ 12,000,000 = 0.067 bits per pixel. That is far below anything that looks acceptable, so the pixel count must fall. At 1.0 bit per pixel the photo should shrink to about 800,000 pixels, about 1,033 × 775, which is a little over a quarter of each side.

Here is what the ZYSNOR tool does with it. It starts at the full size, finds that even its lowest quality (0.12) is too big and reduces each side by 20% at a time: 3,200 × 2,400, then 2,560 × 1,920, 2,048 × 1,536, 1,638 × 1,228. Our test photo needed about 0.31 bits per pixel at quality 0.12, so we expect 100,000 bytes to pay for roughly 2.6 million pixels and the first size to fit to be 1,638 × 1,228, which is about 0.4 bits per pixel. That is below the tool's 0.6 floor, so it takes one more step to about 1,310 × 982, where the limit pays for about 0.62 bits per pixel. This is our estimate from the algorithm and one test photo; we did not run a real 12-megapixel photo. If you want a different balance, resize first with the Image Resizer and then compress.

What happens at each limit

We ran the live tool on the coffee photo at five limits. From 100 KB down to 20 KB it kept all 600 × 400 pixels and only lowered the quality. At 10 KB it also shrank the picture to 384 × 256, because quality alone would have left only 0.33 bits per pixel.

Five bars of picture similarity at limits of 100, 50, 30, 20 and 10 KB for one photo: 0.991, 0.935, 0.894, 0.848 and 0.764
Each step down in the limit costs more picture than the one before. The 10 KB bar uses a 384 × 256 version.
LimitOutputPixelsBits per pixelSSIMPSNR
100 KB95,992 B600 × 4003.200.99143.6 dB
50 KB48,596 B600 × 4001.620.93534.4 dB
30 KB29,585 B600 × 4000.990.89431.7 dB
20 KB19,710 B600 × 4000.660.84829.8 dB
10 KB9,974 B384 × 2560.810.76427.3 dB

SSIM (structural similarity) scores 1.0 for an identical picture and falls as the structure of the picture changes; PSNR is an older measure in decibels. For the 10 KB row we enlarged the smaller picture back to 600 × 400 before comparing it with the original. Google's WebP study explains why SSIM is generally preferred. Neither is the same as a person looking at the picture, so treat the numbers as a ladder rather than a verdict.

The ladder is not even. Going from 100 KB to 50 KB cost 0.056 of SSIM, and going from 20 KB to 10 KB cost 0.084 for half as many bytes saved. Wallace's 1992 article gives a rough guide for ordinary colour photographs of that era: about 0.5 to 0.75 bits per pixel for good to very good quality, with excellent above that. Our 20 KB result (0.66 bits per pixel) sits inside that band. At 10 KB the tool reaches 0.81 bits per pixel only by using fewer pixels.

The other two photos behaved the same way: they kept their size down to 20 KB and were shrunk only at 10 KB (the cat photo to 360 × 240, the astronaut to 327 × 327). When a photo already fits, the tool just re-saves it at its top quality (0.94): the cat photo, 50,163 bytes originally, came out at 46,668 bytes at both the 100 and 50 KB limits. A bigger number in the limit box therefore never inflates the file.

Why the tool shrinks the picture at very small limits

To see whether shrinking first helps at very small limits, we ran a 10 KB test with one encoder (Pillow), resizing the coffee photo to six sizes and then finding the best quality that stays under 10,000 bytes. Each result was enlarged back to 600 × 400 for comparison with the original.

Six bars of SSIM for the same photo squeezed to about 10 KB at different pixel sizes, with the best at 360 by 240
A modest shrink beat keeping every pixel: 0.764 at 360 × 240 against 0.698 at 600 × 400.

With that encoder, keeping all 600 × 400 pixels scored 0.698, and the best result was 360 × 240 at 0.764. Shrinking further to 300 × 200 did not help (0.761). The best sizes sat at about 0.7 to 1.3 bits per pixel.

So the tool keeps shrinking by 20% while the result is under 0.6 bits per pixel. At a 10 KB limit it gave 0.764 for the coffee photo (384 × 256), 0.901 for the cat photo (360 × 240) and 0.851 for the astronaut (327 × 327), scored against the originals. At 20 KB and above every pixel is kept, because those photos are already above 0.6 bits per pixel. The 0.6 rule comes from one photo and a small test; for a face or a document photo, look at the result and decide.

JPG, WebP or PNG?

PNG stores every pixel without loss and is the wrong tool for a photo size limit: our coffee photo is 461,327 bytes as a PNG and 104,711 as a high-quality JPEG. Use PNG only for logos, screenshots and pictures that need transparency; JPG has no transparency, so the ZYSNOR tool fills transparent areas with white.

WebP is Google's newer format. Google's study reports lossy WebP files 25% to 34% smaller than JPEG at the same SSIM, using the libjpeg encoder as the JPEG baseline. In our test the same pattern appeared at two limits with the tool's own encoders: at 30 KB, WebP scored 0.928 against 0.894 for JPG, and at 20 KB, 0.885 against 0.848. At 10 KB both formats ended at 384 × 256 and WebP scored 0.812 against 0.764 for JPG. The gain depends on the encoder and the picture, and a form that asks for a JPG will reject a WebP, so choose WebP only where the form says it is accepted.

Common mistakes

  • Renaming a file. Changing photo.png to photo.jpg changes the label, not the data. The size stays the same and some forms detect the mismatch.
  • Using a screenshot. A screenshot is usually a PNG of every screen pixel. Take or convert to a real JPG instead.
  • Ignoring the margin. A file of 100.4 kB passes a 100 KB checker on a computer that shows 98 KB and fails the strict one. Aim under in bytes.
  • Cropping last. Cutting empty background before compressing removes pixels outright. Cropping away half the area saves about half the bytes at the same bits per pixel, with no loss to the part you keep.
  • Fearing a second save. In our test, saving a photo ten times at the same quality barely changed it: the similarity score went from 0.908 after the first save to 0.907 after the tenth, and the size stayed 41.5 KB. But alternating two different qualities (85, then 70) dropped the score from 0.931 to 0.873 on the second save and then stayed near 0.869. Start from the original file when you can, and change the setting once.
  • Asking for an exact size. The tool finds the highest quality under your limit in nine halving steps, so the result is just under it (95,992 bytes for a 100 KB limit), not exactly equal. Making a file bigger on purpose is not something it does.

Practice problems

Problem 1. A 1,600 × 1,200 photo must be at most 150 kB. How many bits per pixel does that allow?
Answer: 150,000 × 8 = 1,200,000 bits; 1,600 × 1,200 = 1,920,000 pixels; 1,200,000 ÷ 1,920,000 = 0.625 bits per pixel. That is inside Wallace's 0.5 to 0.75 band, so quality alone should be enough.

Problem 2. The form says 250 KB. What is the safe target in bytes, and what is it in KiB?
Answer: 250,000 bytes, which is 250,000 ÷ 1,024 = 244.1 KiB. A file under 244 KiB passes under either meaning.

Problem 3. About how big is an 800 × 600 photo at 1.2 bits per pixel?
Answer: 800 × 600 = 480,000 pixels; 480,000 × 1.2 ÷ 8 = 72,000 bytes.

Problem 4. A 3,000 × 2,000 photo must be at most 100 kB. What size would give about 1 bit per pixel?
Answer: 100,000 × 8 = 800,000 bits, so 800,000 pixels. The scale factor is √(800,000 ÷ 6,000,000) = 0.365, giving about 1,095 × 730. At the full size the budget is only 0.13 bits per pixel, which is too low.

Limits of this guide

  • We tested three small photos in one browser (Chromium 153). Firefox and Safari use their own encoders, so sizes for the same setting will differ.
  • SSIM and PSNR compare numbers, not eyes. Faces, text and sharp edges can look worse than the score suggests.
  • The phone-photo example in section 6 is an estimate from the tool's algorithm, not a run on a 12-megapixel image.
  • We do not list any country's or agency's photo limits. The official pages that publish them could not be read for this review, and they change; use the limit shown on your own form.
  • The 0.6 bits per pixel rule is our own choice, set from one photo and checked on two more at 10 KB. It is not a standard.
  • The size ladder depends on the picture. A smooth sky compresses far better than a crowd.

Glossary

  • Pixel: one dot of the picture.
  • Bit and byte: a byte is 8 bits.
  • kB and KiB: 1,000 bytes and 1,024 bytes.
  • Bits per pixel (bpp): compressed file bits divided by pixels.
  • Lossy and lossless: lossy compression throws detail away for good; lossless can restore the original exactly.
  • DCT: the discrete cosine transform, which rewrites a block of pixels as waves.
  • Quantization: the rounding step that is the main source of loss in JPEG.
  • SSIM: a similarity score from 0 to 1 between a picture and its original.

Common questions

How do I reduce a photo to 100 KB?

Choose the photo in the ZYSNOR Image Compressor, enter 100 in the size box and select Create JPG. The tool lowers the quality, and the pixel size only if needed, until the file is under 100,000 bytes.

How do I reduce a photo to 50 KB or 20 KB?

Enter 50 or 20 as the limit. In our test a 600 × 400 photo kept its full size at both limits. For very small limits the tool also reduces the pixel size by itself.

Is 1 KB 1,000 or 1,024 bytes?

Both are in use. SI defines kilo as 1,000, and the IEC created the kibibyte (1,024 bytes) in 1998 to remove the confusion. The ZYSNOR tool counts 1,000, so its files also pass a 1,024-byte check.

Does compressing a photo lower its quality?

Yes, JPEG and lossy WebP discard detail. At 100 KB our test photo kept a similarity score of 0.991; at 10 KB it fell to 0.764 even after the tool shrank the picture.

Why is my file not exactly the size I typed?

The tool searches for the highest quality that fits the limit, so the result lands just under it. A file already below the limit is only re-saved at high quality.

Should I choose JPG or WebP?

Choose JPG unless the form says WebP is accepted. WebP files are smaller at the same quality, but many forms reject them.

Why did my transparent PNG get a white background?

JPG cannot store transparency, so the tool fills transparent areas with white.

Is my photo uploaded to a server?

No. The ZYSNOR tool runs in your browser and your file stays on your device.

Sources and how we researched this

Sources (7)

How we researched this

We read three primary sources: Gregory Wallace's account of the JPEG standard (1991 and 1992), the text of ITU-T Recommendation T.81 (approved 18 September 1992, identical to ISO/IEC 10918-1), and the browser documentation for the canvas quality setting that web tools use. We also read NIST's page on binary prefixes for the KB question and Google's published WebP compression study for the format comparison. Google's study page could not be opened directly in our review; its main claim was read from a search excerpt of the page, so we describe it as Google's claim.

Every number in the tables was measured, not copied. We ran the live ZYSNOR Image Compressor in Chromium 153 on three public-domain sample photos (an astronaut portrait by NASA, a coffee cup photographed by Rachel Michetti and a cat photographed by Stefan van der Walt; the last two are CC0 and the first has no known copyright restrictions, per the scikit-image sample data notes). We then measured each output file against its source with SSIM and PSNR in Python. The size-against-quality chart comes from the browser's own canvas encoder; the shrink-first and repeated-saving tests used the Pillow encoder because they needed exact control over the settings.

The Image Compressor was changed on 19 November 2026 to shrink the pixel size for very small limits (the 0.6 bits per pixel rule above); every tool result in this guide was measured again after that change. These are small photos (300 to 600 pixels wide), so a 12-megapixel phone photo will give bigger files; the pattern in bits per pixel carries over, the byte counts do not. If a result here does not match what you see, tell us through the feedback box on the Image Compressor page and we will check it.

Related guides

Rules differ between schools and change over time. Always check your own school or university handbook.