Image Compressor

Phone photos are often 3–5 MB; most web pages need them under 300 KB. Drop in one image or a batch, pick a quality level, and compare the before and after sizes for each file.

75–80% quality is visually lossless for most photos. PNG output is lossless, so choose WebP or JPG for the biggest savings.

Image Compression Explained: Lossy vs Lossless and the Best Quality Settings

Every image on the web is compressed in some way. An uncompressed 1920 × 1080 photo would be about 6 MB (1920 × 1080 pixels × 3 bytes per pixel). A well-compressed version of the same photo can be 150 KB and look identical at normal viewing size. Knowing how compression works helps you pick settings that cut file size dramatically without visible damage.

Image compression comparison of a city photo saved as PNG and a compressed WebP file

Two kinds of compression

Lossless compression shrinks the file without changing a single pixel. Decompress it and you get exactly the original image back. It works by finding patterns and repetition, much like a ZIP file. PNG, GIF and lossless WebP use lossless compression.

Lossy compression throws away information that people are unlikely to notice, then compresses what remains. The decoded image is close to the original but not identical. JPEG, lossy WebP and AVIF are lossy formats, and they can make photos 5–20 times smaller than lossless formats.

LosslessLossy
Pixels after decodingIdenticalApproximation
Typical photo savingsModestVery large
Re-saving repeatedlyNo degradationQuality drops each time (“generation loss”)
Best forScreenshots, logos, text, line art, editing mastersPhotographs, complex images
FormatsPNG, GIF, lossless WebP, lossless AVIFJPEG, WebP, AVIF

How lossy compression decides what to throw away

JPEG, the format that defined web photography since 1992, uses several tricks based on how human vision works:

  1. Color subsampling. Our eyes are more sensitive to changes in brightness than in color. JPEG usually stores color at half resolution in each direction (4:2:0), cutting the color data by 75% with little visible effect on photos.
  2. Frequency transformation. The image is split into 8×8 pixel blocks, and each block is described as a combination of smooth and detailed patterns (the discrete cosine transform).
  3. Quantization. Fine detail patterns, which the eye notices least, are stored with less precision or dropped. This is what the quality slider controls. Lower quality means coarser quantization and more detail thrown away.
  4. Entropy coding. The remaining data is packed efficiently, losslessly.

WebP and AVIF use more advanced techniques, including predicting blocks from their neighbours and variable block sizes, which is why they compress better at the same visible quality.

What the quality number means

The quality setting (usually 0–100) is not a percentage of quality. It maps to the quantization tables the encoder uses, and different software maps the numbers differently: quality 80 in one program isn’t identical to quality 80 in another. Still, some patterns hold for photos:

QualityTypical resultUse
90–100Visually lossless, large filesPrint masters, archives (better: keep the original)
75–85Excellent; differences hard to see at normal sizeMost web photos
60–75Good for photos with lots of texture; slight softeningThumbnails, backgrounds
Below 60Visible blockiness, smudged edges, color bandsRarely worth it

The jump from quality 100 to 85 often halves the file size with no visible change. The jump from 75 to 50 saves less and starts to look bad. The image compressor above defaults to 75% WebP, a good balance for most photos.

Artifacts to look out for

  • Blocking: visible 8×8 squares in smooth areas like sky.
  • Ringing (mosquito noise): fuzzy halos around sharp edges and text.
  • Color bleeding: colors smearing past edges, from subsampling.
  • Banding: smooth gradients turning into visible steps.

Always check compressed images at 100% zoom, not shrunk to fit your screen, which hides artifacts.

Why screenshots should be lossless

Screenshots, diagrams, logos and anything with text have sharp edges and large flat areas of color. Lossy compression handles these badly: edges get ringing artifacts, and text looks smudgy. Lossless PNG or lossless WebP is usually smaller and sharper for this kind of content. Photos are the opposite: PNG versions can be 5–10 times larger than a good JPEG.

Resize before you compress

Compression works on the pixels you give it. A 4000-pixel-wide photo compressed hard still contains 12 million pixels. Resizing it to its display size first (for example 1600 pixels) removes most of the data before compression even starts. Our guide to resizing images for the web explains how to choose dimensions.

Format matters too

At the same visual quality, typical sizes for a photo are roughly:

FormatRelative size
JPEG (quality ~80)100%
WebP (quality ~75)~65–75%
AVIF (quality ~50–60)~45–60%

These are rough figures; results vary by image. We compare the formats in detail in JPG vs PNG vs WebP vs AVIF.

A test with three 12-megapixel photos

To see what the quality slider does in practice, we took three photos at 4032 × 3024, the size a 12-megapixel phone camera produces, and re-encoded each one with Chrome’s built-in encoders, the same ones the compressor above uses: a fjord landscape (photo 1), a dog wrapped in a blanket against a blurred background (photo 2), and a pine forest below granite cliffs (photo 3). The originals were already-compressed JPEGs of 1.63 MB, 1.88 MB and 2.37 MB.

Setting (full 4032 × 3024)Photo 1Photo 2Photo 3
Original JPEG1.63 MB1.88 MB2.37 MB
JPEG quality 902.10 MB2.41 MB3.05 MB
JPEG quality 751.71 MB1.95 MB2.48 MB
WebP quality 751.20 MB1.54 MB1.99 MB
WebP quality 601.01 MB1.22 MB1.68 MB
WebP quality 40792 KB864 KB1.30 MB

Two things stood out. First, re-saving at JPEG 90 made every file bigger than the original, by about 30%. The originals had already thrown detail away, and a high quality setting spends bytes faithfully preserving the compression noise. Quality numbers also aren’t comparable between tools: “90” in one encoder is not “90” in another.

Second, at full resolution even WebP 60 only took about a third off. The large savings came from changing the pixel dimensions, not the quality setting. The same three photos resized to 1600px wide and saved as WebP 75 came out at 239 KB, 173 KB and 384 KB, between 84% and 91% smaller than the originals. That is why the compressor has a maximum width option, and why it is worth using.

Avoid generation loss

Each time you open a lossy image, edit it and save it again as lossy, it loses a bit more quality. Keep a lossless or original master, do all edits on that, and export a compressed copy only at the end.

Metadata is part of the file size

Photos from phones and cameras carry EXIF metadata: camera model, date, settings and often GPS coordinates. It can add tens of kilobytes, and it can reveal where a photo was taken. Re-encoding through a canvas, as browser-based compressors do, drops this data. If you only want to remove metadata without re-compressing, see our EXIF and privacy guide.

A sensible workflow

  1. Keep the original file.
  2. Crop and resize to the largest display size (× 2 for high-density screens).
  3. Choose a format: WebP or AVIF for photos on websites, PNG or lossless WebP for screenshots and graphics.
  4. Compress at around 75–80 for photos and compare against the original at 100% zoom.
  5. Check the result loads quickly on a real phone connection.