Most image compressors give you a quality slider and let you guess. You move it to 70%, download the result, check the file size, find it's still too large, go back, move the slider lower, repeat. It's tedious — and it still doesn't guarantee you land on the exact number a portal is asking for.
The ResizeImageOnline compressor lets you type in a target file size in KB or MB and hit it directly — no guessing, no iterations. This article explains why most tools can't do this, how binary-search compression works, and the limits of what any tool can achieve when targets are very small.
JPEG and WebP compression don't work by targeting a file size. They work by targeting a quality level — a setting that controls how aggressively high-frequency detail is discarded. The relationship between quality and file size varies by image content:
The curve is not linear, and it shifts with every image. A quality slider gives you control over how much quality you trade away — not control over the final file size. That's why guessing with a slider rarely lands you exactly at "under 50KB" or "between 20KB and 50KB."
A tool that targets an exact file size has to run multiple compression passes. The approach is similar to binary search:
This takes several passes — typically 4–8 — which is why it can't be done manually in a reasonable time. Our compressor runs this process in your browser using the Canvas API, so your image never leaves your device.
Common file size targets and the tools for them:
Here's the part most guides skip. File size is a function of both quality and pixel count. A 4000×3000px photograph at quality 85 might be 2.5MB. Reduce quality to 40% and you might get it to 400KB — but with severe visible artifacts. The only way to get that same image to 50KB is to reduce its pixel dimensions as well.
A rough rule: for a target of 20KB, most photos need to be under 800×600px. For 50KB, under 1200×900px at moderate quality. If a portal requires both a minimum pixel dimension (e.g., "at least 600×800px") and a maximum file size (e.g., "under 50KB"), you're working within a constrained range — and you may need to reduce quality more aggressively than usual.
When a portal's combination of minimum dimensions and maximum file size is very tight, it means they are intentionally accepting lower-quality images. Their system is designed for that. Don't try to keep the quality high — meet the constraints and move on.
One source of confusion is that file sizes are reported differently by different systems. The precise values are:
Some portals specify limits in "KB" and mean exactly this. A portal that says "maximum 50KB" means the file must be 51,200 bytes or fewer. If your compressor reports sizes in decimal (where 1KB = 1,000 bytes), your 50KB output might actually be 50,000 bytes — safely within range — or it might be reported as 49KB in decimal terms. When a portal's check is strict, aim for 5–10% below the stated maximum to account for rounding and byte-counting differences.
If you've compressed the image and it's still above the portal's limit, the next step is to reduce the pixel dimensions. Use our image compressor to set a pixel width or use a separate resizer, then compress again. The combination of reduced dimensions and moderate quality almost always reaches any target size without visually unacceptable quality loss.
JPEG compression targets a quality level, not a file size. The relationship between quality and output size varies by image content — the same quality setting produces very different file sizes for a complex photo versus a flat graphic. Hitting an exact size requires multiple compression passes with a binary-search approach.
For a photograph, quality 60–70% is visually acceptable for most uses. Below quality 40%, JPEG blocking artifacts become severe. For very small targets under 20KB, reducing the image dimensions is usually necessary alongside quality reduction.
Common reasons: the portal also checks pixel dimensions (not just file size); you're mixing up KB and MB; or the portal counts bytes differently from your file manager. Aim 5–10% below the stated maximum to give yourself a margin.
Not directly — PNG is lossless with no quality dial. To hit a size target with a PNG source, the tool converts it to JPEG or WebP first. If you need PNG output specifically, reducing image dimensions is the most effective lever.
Significantly. File size scales with pixel count — halving both dimensions reduces pixel count by 75%. A 3000×2000px image at quality 85 will always be larger than a 1500×1000px image at the same quality. For targets under 50KB, reducing dimensions is often necessary.