toolgarden.xyz
中文

Image Compressor

Free online image compressor for JPG, PNG, WebP, and other images locally in your browser, preserving the original format by default with optional WebP output

Smart compression

Compression strategy

Keep the original format by default

AUTO

When WebP is off, JPG exports as JPG, PNG exports as PNG, and WebP exports as WebP. The original file is kept when no safe compression is available.

Supported formats
JPGPNGWebPGIFBMPSVGAVIF
Files0 files selected
Saved0%
Original total--
Compressed total--

Local Worker + OffscreenCanvas is used first. Images are not uploaded.

Need a larger image?Use Image Upscale to enlarge images at 2x, 3x, 4x, or custom dimensions, then come back to compress the result.

Compressed images

-42%

Waiting for images

Upload images to compress automatically, compare previews, and download individual files or a ZIP.

About this tool

Compressing an image means re-encoding it: decode the original to pixels, then encode back out at the quality you choose. That quality setting governs how much visually insignificant information the encoder is allowed to discard; so compression here is lossy, and a different thing from the fully reversible compression in a ZIP file.

How much you save depends far more on content than on the original file size. Photographs, gradients and noisy scenes have a lot of redundancy to give up. Flat colour, screenshots and line art already have low entropy, so they shrink very little; and lossy encoding may add visible artefacts around the text edges. Those images are better left as PNG, or moved to lossless WebP.

When the goal is page load speed, changing format usually beats tuning quality: at matching perceived quality WebP is typically about thirty percent smaller than JPG, and AVIF smaller again. The tool keeps the original format by default and lets you switch the output to WebP when you want that trade.

How to use it

  1. Pick or drop in your images

    JPG, PNG, WebP and the other common formats are accepted, several at a time. Decoding happens in the browser; nothing is uploaded.

  2. Set the quality

    Lower means smaller and lossier. Photographic material is usually indistinguishable at 70-80; anything containing text or fine lines wants a higher setting, or a lossless output format instead.

  3. Compare the preview before you commit

    Check the before and after. Look specifically at text edges, smooth gradient transitions and shadow detail; lossy artefacts surface in those three places first.

  4. Export, changing format if needed

    Export once you are happy; multiple images can be downloaded together. If the result is still too large, switching the output to WebP is usually a better trade than pushing quality lower.

Supported range and limits

Input formats
JPG, PNG, WebP, GIF, BMP, AVIF; anything the browser can decode
Output format
Matches the input by default; WebP can be selected explicitly
Compression type
Lossy re-encode (lossless optimisation when the output is PNG)
Transparency
Preserved for PNG and WebP output; filled in when the output is JPG
Metadata
Re-encoding discards EXIF. Inspect and save it separately with the EXIF tool if you need it
Size limit
Bounded by browser memory; very large images, especially many at once, can fail

When you would use it

  • Making page images load faster

    Straight-from-camera photos are usually much larger than a page needs. Resize to the display dimensions first, then compare the real PNG, JPG, or WebP exports to reduce first-paint cost at an acceptable visual quality.

  • Getting under an email or form size limit

    Plenty of systems cap an attachment at a few megabytes. Lowering quality beats cropping: cropping removes content, while compression only removes detail you were unlikely to notice.

  • Normalising a set of assets

    Processing several images with one set of parameters gives consistent size and appearance across the set; less work than adjusting each one in an image editor, and nothing gets missed.

What to know before you start

  • Lossy compression is irreversible. Compressing an already-compressed image discards information on top of information that is already gone, and edge artefacts accumulate visibly. Always start from the original, never from the previous output.
  • Screenshots, line art and text-heavy images are poor candidates for lossy compression. Their information sits at the edges, which is exactly where lossy encoding produces ringing; usually a small size saving for a clearly worse image. Use PNG or lossless WebP for these.
  • Re-encoding drops EXIF. That is helpful before publishing, since location and device data go with it, but if you need the capture settings on file, save a copy of the original first.
  • JPG output has no alpha channel, so transparent areas become an opaque fill. Export PNG or WebP when the transparent background has to survive.

Related concepts

Lossy vs lossless
Lossy encoding discards information to buy size and cannot be undone; lossless encoding only reorganises data and restores exactly. JPG and AVIF are lossy, PNG is lossless, WebP offers both modes.
Quality setting
The encoder's trade-off dial, not a percentage of image fidelity. The same number behaves differently across formats and encoders, which is why you judge by preview rather than memorising a "safe" value.
Ringing
The rippling artefact lossy encoders produce near high-contrast edges. It is the direct reason text and line art compress badly.

Frequently asked questions

Does Image Compressor upload my files?
No. Compression runs locally in your browser, using Worker and OffscreenCanvas when available. Images are not uploaded to a server.
How does it choose the compression level automatically?
For each image, the tool tries conservative quality levels for the selected output mode and compares pixel samples with the source. PNG files use color quantization by default; WebP is used only when the WebP option is enabled.
Why are some images marked as already near optimal?
If the browser encoder cannot produce a smaller visually safe result, the original file is kept to avoid increasing file size or creating obvious quality loss.
Can I download compressed images in bulk?
Yes. After multiple images finish compressing, you can download files individually or export all results as one ZIP archive.
Why did the file size barely change?
Because that image had little redundancy to begin with; screenshots, flat colour and line art all fall in this group. Pushing quality lower will degrade the picture without shrinking it; lossless WebP or staying on PNG is the better answer.
What quality setting should I use?
There is no universal number; it depends on content and purpose. Photographic material is usually indistinguishable at 70-80, and anything with text needs more. Judge from the side-by-side preview, watching text edges and gradient transitions.
Does compressing change the image dimensions?
No. Compression only changes the encoding; pixel width and height stay the same. If you want smaller dimensions that is Image Resize; and combining the two, resizing first and then compressing, gives by far the biggest size reduction.