Practical image workflow

How to Compress Images to a Target File Size

Set a byte budget, preserve the right format, and verify the actual result instead of assuming a slider guarantees an upload limit.

Translate the upload limit into bytes

Start with the receiving service’s instructions. A pixel limit and a file-size limit are separate requirements. In FileOnTap, decimal KB means 1,000 bytes and KiB means 1,024 bytes. For example, 100KB is 100,000 bytes while 100KiB is 102,400 bytes. If a service does not define its units, choose a conservative target below the stated maximum and verify the saved file. Renaming the extension does not change the encoding or byte count.

Choose a format before optimizing

Keep JPG for an ordinary photo when transparency is unnecessary. PNG preserves transparent pixels and sharp graphics, but complex photos may need much more space. WebP can be useful when the receiving service explicitly accepts it. The compressor preserves the input format; use the image converter first if changing format is allowed. A smaller file is not automatically an acceptable file: an application may reject WebP even when its byte count is below the limit.

Run a measured compression pass

Select up to 10 JPG, PNG or WebP files and enter the target. Quality limits the starting JPG/WebP quality; the search can lower quality and dimensions to approach the budget. PNG has no lossy quality slider effect, so its search can reduce pixels. Review each row’s actual bytes and target status. If the original already fits, it is retained. If re-encoding would enlarge it, the original is also retained and may still miss a very small target. There is no promise of lossless target-size compression.

Check detail, dimensions and the saved file

Open the downloaded result at actual size. Check faces, small text, edges and transparent regions. Dimension reductions may violate a minimum-width rule even when bytes fit. Compare the saved byte count with the receiver’s rule, then submit to the intended service yourself. FileOnTap does not test or certify that service’s acceptance. Keep your original separately; browser export does not guarantee original metadata, DPI, color profiles or HDR.

When to resize first

If the form names exact dimensions, resize first with crop or pad rather than allowing a compression search to choose them. Then compress and check that the dimensions still meet the requirements. If compression changes them, use a different format when allowed, prepare a simpler source, or accept that the requirements cannot be satisfied by that image. Download successes individually or as a ZIP under the 100MiB output cap; a ZIP does not change each image’s size.

Further reading

Browser image export and file-size units: MDN canvas toBlob and NIST SI prefixes. These describe APIs and units, not a guarantee of any upload service accepting your file.

Tools and related guidescompress imagecompress image to 50kbcompress image to 100kbcompress image to 200kbresize imagewhy image compression misses target size