The Image Compressor reads one local image file, re-encodes it as JPEG on a canvas, and shows the size change before you download anything. You pick the file with the file picker, the page draws it at its original dimensions, and the canvas re-encodes it at the quality on the slider, which defaults to 70%. The readout then prints the original size, the estimated compressed size, and the percentage, like 2,400,000B โ 833,351B (-65%), and a side-by-side preview shows the original next to the result. Everything is a browser-side canvas call: the file bytes never leave the device, and no upload happens at any point.
What the tool takes and what it gives
The input is a single file field that accepts image files, and nothing else is asked. The original size is the file's exact on-disk byte count, so the left half of the readout is precise. The output is always a JPEG: the canvas hands its pixels to the browser's JPEG encoder, the output format is fixed and not selectable, and the width and height stay exactly what the input was. The only control is the quality slider, which runs from 10 to 95 in steps of 5, giving 18 stops, and moving it re-encodes the kept original immediately, so the readout and the preview update live. When you are happy with the size, the download button writes the result to your disk as compressed.jpg; the file you save is the ground truth for the actual byte count.
Why the output is always JPEG
The re-encode is one canvas call whose output type is hard-set to JPEG, so a PNG in becomes a JPEG out, a WebP in becomes a JPEG out, and a GIF in keeps only its first frame, because the image element decodes only the first frame of an animated file. Two consequences follow from the fixed format. First, JPEG has no alpha channel, so a transparent PNG does not stay transparent: the transparent pixels are composited over black before encoding, and what you download has black where the input had transparency. Second, the tool uses the browser's own decoder with no fallback, so a format the browser cannot decode, such as HEIC on most platforms, simply never finishes decoding and the page renders nothing for it.
How the size is read out
The compressed size is an estimate, and a deliberately simple one. The canvas returns a data URL, a 23-character data:image/jpeg;base64, prefix followed by base64, and the page takes the whole string length and multiplies it by three quarters, since base64 uses four characters for every three bytes. That estimate overshoots the true byte count by the prefix alone, which works out to 17 to 19 bytes over: a 1,000,000-byte JPEG reads as 1,000,019B, and a 999,999-byte one reads as 1,000,016B. In a full run, a 2,400,000B file whose encoder output is 833,333 bytes prints 2,400,000B โ 833,351B (-65%); the percentage is rounded, so the displayed number and the exact arithmetic can differ by one point.
When the file gets bigger
The savings percentage is the round of one minus the compressed size over the original size, times one hundred, and a negative result is shown with a plus, so a file that grew is reported as, for example, 45,000B โ 47,018B (+4%). That happens for small images, where the encoder's fixed overhead dominates, for a JPEG that is already compressed at or below the selected quality, and whenever the slider sits above the quality the original file was actually saved at. The direction is not a bug: at 10 the output is the smallest it will get and at 95 the largest, so if the readout climbs as you raise the quality, the original was already leaner than the encoder wants to make it.
Where the pixels go
The file is read with the FileReader into a data URL on the page, and the only computation is the canvas draw plus the JPEG encode, so the bytes never leave the device and there is no network request at any point. There is also no persistence: the page keeps the data URL only while it is open, there is no history and no cache, and closing or reloading the tab discards the image and the result. The single artifact that can leave the device is the compressed.jpg you choose to download, and you choose that yourself.
What it is not
The tool keeps the input dimensions exactly, so it is not a resizer; changing the pixel size is what the Image Resizer does. It is not a format converter either, because the output is fixed to JPEG; choosing the output format is the job of the Image Converter. It does not read or display the file's metadata, which the Image Info Viewer shows, and it does not crop the frame; for that, see the cropping guide.