Reduce image file size toward a target
Choose an image and a target size. The tool adjusts encoding and dimensions within a limited number of attempts, so the exact KB target is not guaranteed.
Runs locally in your browserChoose an image and a target size. The tool adjusts encoding and dimensions within a limited number of attempts, so the exact KB target is not guaranteed.
Runs locally in your browserPick an image, set the target weight in kilobytes and press Process files. Everything happens in this browser: the file is not uploaded, and the page keeps working after the network drops. The result shows the input size, the output size, the pixel dimensions, the target and the percentage saved, and the same bytes are offered through Download result.
The target is a goal, not a promise. The tool re-encodes the image up to ten times, first lowering the quality in steps of ten points down to 45, then scaling the dimensions to 84 % of the previous attempt. Some images - a PNG screenshot, for instance - cannot be pushed below a given weight that way, and the page says so instead of claiming the target was met.
Every attempt draws the image on a canvas at the current size and encodes it again. The first attempts lower the quality in steps of ten points until 45; after that the image is scaled to 84 % of its previous dimensions, which removes roughly 30 % of the pixels per step. The loop stops as soon as an attempt is at or below the target, and at the latest after ten attempts.
PNG is lossless, so the quality control cannot change its output: a target on a PNG is approached by resizing alone. That is why a very small target on a PNG produces a visibly smaller image rather than a more compressed one.
Input size, output size and the saving percentage are measured, not estimated. The saving turns negative when the re-encoded file ends up larger than the file you supplied. Dimensions are the pixel size of the result, which drops as soon as the tool starts scaling.
When the file already fits the target, and neither the format nor the maximum width asks for a change, the original file is kept as the result and the status line says so - re-encoding it would only add weight. When ten attempts are not enough, the status line reports the smallest result reached and, for PNG, why the quality setting stopped helping.
The pixels are rewritten, so data stored beside them is dropped: EXIF, GPS coordinates, camera model, colour profile. That is a useful side effect when the file is shared, and a reason to keep the original when those fields matter.
JPEG and WebP are lossy, PNG is lossless, and transparency is flattened onto white when the output is JPEG. Animated GIF and WebP files are decoded as a single frame, the first one. Every re-encode of an already compressed file costs a little more quality, so compress from the original rather than from a previous result.