GUIDE

How Image Compression Works

Understand image compression, lossy versus lossless formats, and why resizing can matter.

Image compression reduces the amount of data needed to store or transfer an image. It is useful when an attachment is too large, a website loads slowly, or storage space matters. Compression is different from resizing: compression changes how image data is encoded, while resizing changes the pixel dimensions.

Lossy vs lossless compression

Lossy compression discards some image information to reduce file size. JPG is a common example. Higher quality settings usually preserve more detail but create larger files. Lossless compression preserves the image data without the same type of visual loss, although the resulting file may still be much larger than a lossy photographic export.

Why photographs respond well to JPG compression

Photographs contain many gradual color changes and fine details. Lossy photographic codecs can represent these patterns efficiently, especially when the output is viewed at normal size. The right quality level depends on the image and its destination; there is no single quality number that is correct for every photo.

Compression is not the same as resizing

If a photo is 4000 pixels wide but will only be displayed at 1200 pixels, resizing can remove far more unnecessary data than repeatedly lowering quality. In practice, resizing and compression are often used together: first choose a sensible display size, then encode the image at an appropriate quality.

A practical workflow

  1. Start with the original image.
  2. Decide how large the image actually needs to be in pixels.
  3. Resize if the original dimensions are excessive.
  4. Choose a suitable output format.
  5. Adjust quality until the file is small enough without visible defects.
  6. Open the result and check it before replacing the original.

Watch for common compression problems

Excessive compression can create blockiness, ringing around text, smeared detail, or banding in smooth gradients. These artifacts are easier to notice in faces, product photos, screenshots, and graphics with sharp edges. If a small quality increase fixes a visible defect while only adding a modest amount of file size, that trade-off may be worthwhile.

Use the browser tool

The Compress Image tool lets you choose an output format and quality in the browser. For a one-off task, compare the original and exported file before deciding which copy to keep.