Image Compressor

Compress JPEG and WebP images with a live quality slider — entirely in your browser.

How to use

  1. Choose an image (PNG, JPG or WebP) from your device — it is decoded locally, with no upload.
  2. Pick JPEG or WebP and drag the quality slider: the preview and the file size update as you move it.
  3. Compare the before and after sizes side by side, then download the compressed file.

About this tool

Compression is what makes a 4 MB photo fit into a 300 KB slot on a page, an e-mail attachment or a marketplace listing. This tool re-encodes your picture with a lossy codec — JPEG or WebP — at the quality level you choose. Lossy means the encoder deliberately discards detail the eye barely registers: it separates brightness from colour, splits the image into blocks, converts each block into frequency coefficients and quantizes the high-frequency ones more aggressively as the quality value drops. That is why 0.80 usually looks identical to the original at a third of the bytes, while 0.30 starts showing blocky halos around sharp edges.

The slider is the whole point, so the tool recompresses live: every move re-encodes the image on your device and updates the preview and the size counter. That is the only honest way to pick a quality value, because the right number depends on the picture and not on a rule of thumb. Photographs with soft gradients survive aggressive settings; screenshots, logos and flat artwork do not, and can even come out larger than the file you started with. When that happens the tool says so instead of quietly handing you a worse file — flat images with few colours are better served by PNG, and WebP is usually the best compromise when you need small files and transparency at the same time.

Everything runs on the canvas API inside your browser: the file is read with FileReader, drawn to an off-screen canvas and re-encoded with canvas.toBlob. There is no upload, no processing queue and no temporary copy on a server, so you can disconnect from the internet after the page loads and the tool keeps working. Dimensions are capped at 8000 pixels per side to keep browser memory under control, and re-encoding discards EXIF metadata, which as a side effect strips GPS coordinates and camera serial numbers from photos before you share them.

The formula

Reduction = 1 − (compressed bytes ÷ original bytes). The quality parameter (0.1 to 1.0) drives the quantization step of the JPEG or WebP encoder: lower quality means coarser quantization of high-frequency detail, fewer bytes and more visible artefacts.

Frequently asked questions

Does my image leave my browser?

No. The file is decoded and re-encoded with the canvas API on your device — nothing is uploaded, stored or logged. Once the page has loaded, the tool keeps working offline.

Which quality should I choose?

0.80 is the sweet spot for photographs: usually indistinguishable from the original at a fraction of the size. Go down to 0.60 for thumbnails, and stay above 0.85 for images containing text or sharp edges.

Why did my PNG get bigger instead of smaller?

Because flat artwork with few colours compresses better with PNG than with a lossy codec. JPEG and WebP are built for photographs, so a logo or a screenshot re-encoded as JPEG can grow. Keep the original file, or try WebP.

JPEG or WebP?

WebP, in almost every case: at the same visual quality it is typically 25% to 35% smaller than JPEG, it supports transparency and every current browser reads it. Choose JPEG only when the file has to open in older software.

Does compressing change the image dimensions?

No. The pixel dimensions stay exactly the same — only the encoding changes. To change width and height, use the Image Resizer.

Is transparency preserved?

With WebP, yes. JPEG has no alpha channel, so transparent areas are filled with white before encoding.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.