Why two 400 × 400 images have different file sizes
Pixel dimensions alone do not determine a JPEG’s file size. Texture and noise need more encoded detail than a smooth area. These two 400 × 400 samples use matching encoder settings, but only the smoother image fits within a 20,000-byte limit.
We drew the same four colored rings twice on a 400 × 400 canvas. One background is smooth. We added fine, fixed-pattern noise to the other background and left the rings alone. Both were encoded as JPEG at quality 82 with the same chroma subsampling and optimization settings. You can download the actual comparison files.

12,333 bytes · 400 × 400

39,125 bytes · 400 × 400
Which file meets a 20 KB ceiling?
Using the toolkit’s decimal ceiling of 20,000 bytes, the smooth sample has 7,667 bytes to spare. The textured one exceeds the limit by 19,125 bytes. The dimensions are identical. JPEG needs more information to describe fine changes between neighboring pixels than a large, nearly uniform area.
Test a limit on your own file
- Download both JPEGs and open Compress image. Set the maximum to 20 KB and add both samples. Compare the saved byte counts.
- If a form mandates exactly 400 × 400 pixels, inspect the output dimensions as well as the size. For a fixed-size form, use the photo resizer and enter the required dimensions before export.
- Look closely at the ring boundaries or your own smallest lettering. If compression makes important detail unclear, return to the original and remove unnecessary background before encoding again.
If a destination also gives a minimum, compare the actual bytes to both ends of its range. The 12,333-byte example already meets a maximum of 20,000 bytes, but it would fail a minimum of 15,000 bytes. An “under 20 KB” success message only answers the upper-limit question.
Continue with a tool
Prepared by GLV Infotech Solutions. Updated . How your files are handled.