Compress Image

Re-encode a JPEG, PNG, WebP, AVIF, GIF, BMP, ICO, or HEIC image on this device. JPEG and WebP take a quality value. AVIF takes one only when this browser's encoder actually changes the bytes. PNG does not.

Use this tool

Drop a file here, or use the picker. The file type is checked from its contents.

The quality control is for JPEG, WebP, and AVIF when this browser's AVIF encoder changes file size. PNG does not use it. If this browser cannot encode AVIF, the result is PNG.

Result

The result appears in this panel after you run the tool.

About this tool

JPEG and WebP are drawn to a canvas and encoded again with the quality you chose. Quality is the browser’s encoder argument, from 0.1 through 1. It is not a promise that the file will shrink by a matching percent. A JPEG that was already saved at a low quality can come out larger or smaller depending on the image.

PNG is different. Canvas PNG encoding is lossless and does not take a meaningful quality value. This page disables the control for PNG and says so. AVIF keeps the control only after a probe shows that a lower quality and a higher quality produce different byte lengths; otherwise the control is disabled and the file is written without that argument. The new PNG can be larger than the file you opened, especially if the original was optimized by another program. The byte counts on the page are the sizes of the two files. They are not a compression score.

JPEG, PNG, and WebP stay in those formats. AVIF stays AVIF only when this browser encodes it; otherwise the download is PNG. To move a PNG or JPEG to WebP, use a conversion tool after this, or instead of it. Resize the image first if the pixel dimensions are the real reason the file is large. The usual size and pixel guards apply, and an oversized image is rejected instead of being scaled.

Optimizing an image, on this page, means that same re-encode. There is no separate optimizer, and the quality number is not a promise that the file gets smaller.

How to use it

  1. Choose a JPEG, PNG, WebP, AVIF, GIF, BMP, ICO, or HEIC image. The quality control is enabled for JPEG and WebP, and for AVIF when this browser honors it.
  2. For those formats, set quality from 0.1 to 1. Lower values usually make a smaller, less detailed file.
  3. Compress the image. The status line shows the input size and the result size in bytes, not a percentage saved.

Limitations

Same dimensions, a new encode, quality opening at 0.8

The picture is redrawn at the same size

Compress draws the decoded bitmap onto a canvas of the same width and height and encodes that canvas. It does not resize, crop, or change channels. The quality range locally on this page opens at 0.8, which is a different starting point from the 0.92 used on the edit pages. JPEG and WebP always receive that quality number. The control is enabled for them as soon as the file is recognized. AVIF receives a quality number only when a probe encodes one test image at two AVIF settings and the byte lengths differ. Until that probe passes, the AVIF control stays disabled and the encode runs without a quality argument. PNG never receives a quality argument. The browser’s PNG encoder is lossless for the samples on the canvas, and the file can grow, because a casually compressed PNG is often smaller than a fresh browser PNG of the same pixels. The status line reports input bytes and result bytes. It does not report a percentage saved.

GIF input keeps the first frame only, and the quality control does not apply. The GIF rewrite is a 256 usually-color still. BMP often is 24-bit sometimes with partial alpha blended onto white, also without a quality argument. ICO is rewrapped as one image. HEIC cannot be written. The result is PNG, and the quality control stays disabled. If AVIF encoding itself is unavailable, preserve intent becomes PNG even when you asked to keep AVIF.

Repeated JPEG generations

JPEG compression throws away coefficients every time. Compressing a JPEG, then compressing that download, compounds the loss even if both passes use 0.8. Edges that survived the first pass pick up more blur and more ringing on the second. A JPEG that was already small may come out larger or smaller. The quality number is the encoder argument, from 0.1 to 1, not a promise that the file shrinks by a matching fraction. WebP lossy writes behave the same way across generations: each encode is new. A lossless WebP source still goes through the canvas and comes back as whatever this browser’s WebP encoder produced at the quality you set, which is a lossy WebP path when a quality argument is supplied.

When PNG growth is the honest outcome

If the source is an optimized PNG, expect the byte count to rise. That is the encoder having no quality knob and using its own compression level, not a failure to “compress.” Switching a PNG to WebP is a different tool, a converter, which can be lossy on purpose. This page stays on the source MIME except for the HEIC-to-PNG and failed-AVIF-to-PNG substitutions above. For a final JPEG, one compress from the original readily at the quality you can accept beats a chain of three gentle passes.

Privacy

Your file is processed in your browser and is not uploaded to UtilChain. The file name is not sent to analytics.