Image compression

Re-encode images locally by quality, dimensions, format, or target KiB, then verify against the final Blob size and honestly mark whether the target was met or identify the closest result.

Local browser processing
This page has passed the public directory check; full functionality is available after enabling JavaScript.
User Guide

How to use image compression

Images are decoded, compressed, and verified only in the current browser and are not uploaded; the original local files are not modified.

  1. Select an image and a target

    Load JPEG, PNG, or WebP, choose manual quality/size, or enter the target KiB (1 KiB = 1024 bytes).

  2. Set format and lower limit

    Choose the output format, quality, and minimum dimensions; target file size mode searches for a quality level first, then reduces the dimensions using bounded steps if necessary.

  3. Compare and download

    Check the target, actual bytes, difference, dimensions, quality, and attempt count; results exceeding the target require explicit confirmation before downloading.

Limitations and Notes

  • Canvas encoded size is not guaranteed to vary strictly monotonically with quality. The tool checks adjacent candidates, but still cannot guarantee that any image will reach the specified size exactly.
  • If the result still exceeds the target after reaching the quality or size limit, it will display “closest but over target”; it will not use a success color or fabricate a tolerance.
  • Re-encoding may result in the loss of image quality, transparency, animation frames, color profiles, and EXIF/GPS and other metadata; important images should retain the original and be checked by enlarging them.

FAQ

Can the target KiB definitely be achieved?

Not necessarily. Content complexity, the encoder, and minimum dimensions all affect the result; the tool returns tested candidates that meet the target or clearly marks the closest candidate that exceeds it.

What happens if the original image is already smaller than the target size?

When no other format or dimension conversion is required, the tool marks the original image as meeting the requirements and prioritizes preserving the original bytes without meaningless re-encoding.

Why is it larger after compression?

Differences in format, transparency, and encoder may increase the file size; in such cases, the page will display the measured changes and retain the original image as the recommended choice.

Page feedbackFound an issue or have suggestions for improvement?
Feedback features need to be used in the online version

Please enable JavaScript in the online version before submitting; local features of the current tool or example are not affected.

Go to the online version for feedback