# Image Compressor

URL: https://hifreetools.com/image/image-compressor

> Shrink an image's file size by re-encoding it at a quality you choose. See exactly how much you saved, then download — all in your browser.

## Quick answer

To compress an image, lower its quality setting or convert it to a more efficient format like WebP, which re-encodes the picture with less data. This tool does that in your browser: pick a quality (lower = smaller file), optionally cap the dimensions, and it shows the new size and percentage saved before you download. Nothing is uploaded.

The tool draws your image onto an HTML canvas and re-encodes it with the browser's image encoder at the quality you choose. Lossy formats — JPG and WebP — discard visual detail your eye barely notices to reach a smaller file; WebP is typically 25–34% smaller than JPG at similar visual quality. Optionally it scales the image down first, which reduces size further.

## Examples

- Photo for email: 4.2 MB JPG at 80% quality → ≈ 1.1 MB
- Switch to WebP: 900 KB JPG → WebP at 75% → ≈ 380 KB
- Cap dimensions too: 6000×4000 photo, max 1920px, 75% → much smaller file

## FAQ

**Are my images uploaded anywhere?**
No. The compression happens entirely in your browser using the HTML canvas. Your image never leaves your device, so it is safe to use with personal photos.

**What is the difference between JPG and WebP here?**
Both are lossy formats that shrink photos. WebP is newer and usually 25–34% smaller than JPG at the same visual quality, and it is supported by all modern browsers.

**Can I compress a PNG and keep it as PNG?**
No. PNG is a lossless format, so re-saving it as PNG barely changes the size. This tool outputs JPG or WebP, which are designed to compress.

**What quality should I use?**
75–85% is a good default for photos — small files with no obvious quality loss. Go lower only for thumbnails, and keep 90%+ when quality matters more than size.

**Does compressing reduce the image dimensions?**
Not unless you set a maximum width/height. Compression mainly lowers quality; capping the dimensions is an extra, often bigger, saving for web use.

**Will it keep my PNG's transparency?**
JPG does not support transparency, so transparent areas are filled with white. To keep transparency and still shrink the file, choose WebP.


## Sources

- [MDN — HTMLCanvasElement.toBlob() (image encoding)](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)
- [Google for Developers — WebP: An image format for the Web](https://developers.google.com/speed/webp)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Image Compressor", https://hifreetools.com/image/image-compressor
