Compress Images to a Target KB Size
Short answer: BatchWebP can aim for a file-size limit between 10 KB and 5,000 KB. For WebP, JPEG, and browser-supported AVIF output, it tests eight quality values and returns the highest-quality tested result that fits under the limit. If none fits, it returns the tested result closest to the target. The target is therefore a goal, not a guaranteed maximum. Large dimensions, detailed textures, noise, transparency, and the selected output format can prevent an image from reaching a very small limit without visible quality loss.
Product behavior verified: August 2026 against the current BatchWebP browser encoder.
How does Target KB compression work?
When Target KB is enabled, BatchWebP does not upload the image or ask a server to compress it. The browser decodes the source into a canvas and runs a bounded quality search for each image. The search starts between 10% quality and the quality selected in the converter, performs eight encoding passes, and records both the closest result and the best result found under the requested byte limit.
If at least one tested result is below the target, BatchWebP chooses the result with the highest tested quality. If every test is above the target, it returns the closest result instead of silently renaming an oversized file as successful. Always check the output size shown in the queue or CSV report before uploading it to a platform with a hard limit.
How do I compress an image to a specific size?
- Open the image compressor and choose WebP or JPG when a strict size limit matters.
- Select a starting quality. This becomes the upper boundary of the eight-pass search.
- Enable Target KB and enter a value from 10 to 5,000 KB.
- Add the images. BatchWebP searches separately for each file because images with the same dimensions can compress very differently.
- Review the actual output size and comparison preview. Reduce dimensions if an image remains above the target or looks visibly damaged.
- Download individual files or export the completed batch and its CSV report.
Why might an image stay above the target?
| Condition | What happens | What to change |
|---|---|---|
| Very large pixel dimensions | Even low-quality output may contain too much image data. | Reduce Size before lowering quality further. |
| Noise, texture, or fine text | Complex detail is harder to compress cleanly. | Use a less aggressive target or inspect the comparison closely. |
| PNG output | Browser PNG export is lossless; the quality control does not reduce its size. | Resize dimensions or choose WebP/JPG. |
| Target below practical image complexity | All eight tested results remain above the requested limit. | Use the closest result, reduce dimensions, or raise the limit. |
| Browser encoder differences | The same quality value may produce different bytes across browser versions. | Verify the final file in the browser used for production work. |
What target size should I choose?
There is no universal KB value for an article image, product photo, or hero image. Display dimensions, device pixel ratio, subject detail, visual importance, and the receiving platform all change the appropriate limit. Start from the actual upload requirement or a measured page-weight budget rather than copying a generic number. If no external limit exists, compare visual quality first and use the smallest result that still looks acceptable at its real display size.
For a batch with mixed dimensions, avoid forcing every image to one arbitrary size. A small thumbnail and a wide hero image should not automatically receive the same byte budget. Separate them into groups, apply an appropriate Size setting, then use Target KB as a final constraint.
Target KB limitations
- The search is available for WebP, JPEG, and AVIF output when the browser provides the encoder.
- PNG quality is not searched because browser PNG export is lossless.
- Eight tests make the result predictable and bounded, but they do not inspect perceived visual quality.
- The selected quality is the search ceiling; choosing 80% prevents the automatic search from testing above 80%.
- Batch limits remain 100 images, 40 MB per file, 250 MB combined, and 40 megapixels per decoded image.
Open the image compressor and set a Target KB value, or read the CSV optimization report workflow.