What this tool does
Image Compressor re-encodes one image in the browser. The download name is {base}-compressed plus jpg, png, webp, or avif. It does not batch files and it does not target a kilobyte size.
When to choose it instead of a similar DevToolKit tool
- Use this page when you want to change format, quality, and optional pixel size in one pass.
- Use Image Converter when you care more about JPEG background fill or converting to AVIF without a compression-oriented filename.
- Use PNG to WebP when the source is PNG-only and you want max-width/height downscale that never enlarges.
- Use Image Resizer when you need percentage scale, social presets, keep-aspect, or do-not-enlarge.
Supported inputs, limits, and output behavior
- Input
- One JPG, PNG, WebP, or AVIF, up to 20 MB.
- Output
- {base}-compressed.jpg|.png|.webp|.avif
- Quality UI
- Slider 20–95 for JPEG, WebP, and AVIF. Disabled for PNG.
- Presets
- Smallest WebP q55, Balanced WebP q75 (default), High quality WebP q88, PNG lossless q100.
How the transformation actually works
compressImageInBrowser loads the file with an Image element, computes output size, draws with imageSmoothingQuality high, then canvas.toBlob. JPEG, WebP, and AVIF pass quality/100. PNG passes 1. AVIF is rejected up front if canvas.toDataURL("image/avif") is not supported.
Unlike Image Converter, this path does not fill a JPEG background color before drawing. Transparent pixels drawn onto a JPEG canvas follow the canvas default, which is not a chosen matte color.
Step-by-step workflow
- Click Choose image or drop one supported file.
- Review the decoded width and height.
- Pick a compression preset, then override format, quality, and optional Width/Height if needed.
- Click Compress image.
- Inspect Original size vs Compressed size before replacing the original.
What can change in the output
Pixels are resampled to the chosen size and re-quantized for lossy formats. The encoder does not copy EXIF, XMP, ICC, or animation from the source into the new blob. A smaller file is not automatically a better picture; lowering quality or shrinking pixels trades detail for bytes.
Known limitations and failure cases
- There is no promised reduction percentage.
- AVIF export depends on the browser canvas encoder.
- Corrupt or unsupported types fail inspect or load.
- Entering both width and height can stretch the image.
Privacy / where data goes
Decoding, resize, and encoding run in the browser. The image is not posted to a compression API. Ordinary site assets and identified analytics (format, quality, dimensions, byte counts, result codes—not the raw image or filename, per the tool privacy summary) may still occur.
Practical output-review checklist
- Compare at 100% zoom, especially on Smallest.
- Check transparency if you started from PNG or WebP and exported JPEG.
- Keep the original until you accept the new file.