Skip to content
ToolkitHub

Image Compressor

Shrink JPG, PNG and WebP files

Guide

Making images smaller without visible quality loss

By Logappradeep · ServiceNow developer

Large images slow down web pages, bounce off email attachment limits and eat into storage. A photo straight from a modern phone is often 3 to 8 MB, far more than needed for a blog post, a product listing or a chat message. Compression shrinks the file while keeping it looking the same to the eye.

How lossy compression works

JPEG and WebP split an image into small blocks and describe each block as a mix of smooth gradients and fine detail. Human vision is less sensitive to fine detail and to color than to brightness, so the encoder keeps the important information and discards the rest. The quality setting controls how much is discarded. Lowering it from 100 to around 75 to 85 typically cuts file size dramatically with no visible difference; below about 60, blocky artifacts and smeared edges start to appear, especially around text and sharp lines.

Choosing an output format

  • JPG is universally supported and ideal for photos. It does not support transparency.
  • WebP usually produces smaller files than JPG at the same visual quality and supports transparency. All modern browsers display it, though some older desktop software does not open it.
  • PNG is lossless, so it is not a compression target for photos; it suits screenshots, logos and graphics with flat colors.

Before and after comparison

The tool shows the original and compressed versions side by side along with both file sizes. Zoom into areas with fine texture, like hair, foliage or fabric, and into edges with strong contrast, because those are where artifacts show first. If you see none at a given quality, try a lower one; if you see some, nudge the slider up.

Compression is done with the browser's Canvas API: the image is decoded, drawn onto a canvas and re-encoded at your chosen settings. Nothing is uploaded, which is useful for personal photos and unreleased product shots.

Practical tips

  1. Resize first. A 4000-pixel-wide photo displayed at 1200 pixels wastes most of its bytes. Reducing dimensions with the Image Resizer often saves more than any quality setting.
  2. Compress once. Each round of lossy re-encoding loses a little more detail. Keep the original and compress from it, not from an already compressed copy.
  3. Expect metadata to go. Re-encoding through a canvas drops EXIF data such as camera model and GPS location, a privacy bonus, though it also removes the orientation tag, so check that photos are upright.

If the compressed file is larger than the original, the source was already well optimized; keep the original.

Frequently asked questions

What quality setting should I use?

Between 75 and 85 is a good starting point for photos. Lower it until you can see artifacts, then step back up a little.

Why is the compressed file bigger than the original?

The original was already efficiently compressed, or you chose a higher quality than it was saved with. Keep the original in that case.

Does compression remove EXIF data?

Yes. Re-encoding in the browser drops EXIF metadata, including camera details and GPS location.

Are my images uploaded?

No. Compression runs with the Canvas API in your browser, and the result is created on your device.