How compression works
The tool decodes each image and re-encodes it in the same format. JPG and WebP quality can be reduced while dimensions remain unchanged. PNG uses the browser’s PNG encoder; because PNG does not expose a meaningful quality factor here, the interface does not pretend that a quality slider performs lossless optimization.
Target file size
For JPG and WebP, an optional target size uses repeated real encodes and stops at a 35% quality floor. If the requested size cannot be reached without resizing or dropping below that floor, the result says so rather than claiming success.
Limitations
Browser encoders differ slightly. Metadata such as camera EXIF data is not preserved by canvas re-encoding. Very large images may use substantial memory, so this milestone limits processing to 40 megapixels per image.