Atualmente, este artigo está disponível apenas em inglês.

WebPJul 21, 20257 min read

Why WebP Files Can Be Smaller Without Losing Useful Quality

WebP files are often smaller than comparable JPEG or PNG files because the format uses newer compression techniques and supports both lossy and lossless modes. That does not mean every WebP output will be smaller, and it does not mean quality review can be skipped. It means WebP gives website teams a strong set of tools for reducing bytes when the image and settings are a good match.

The practical goal is not to make the smallest possible file. The goal is to remove unnecessary bytes while keeping the image acceptable for its role on the page.

"WebP is smaller and still high quality" is incomplete production guidance without the source type, encoder setting, output size, visual review, and files that got worse. The explanation has to leave room for negative savedRatio values, larger outputs, and assets that should stay PNG, SVG, JPEG, or AVIF.

Images Are Heavy Because Pixels Carry Detail#

A raster image is made of pixels. Each pixel stores color information, and the file format decides how that information is represented, compressed, and decoded later.

File size depends on several factors:

  • dimensions
  • image detail
  • color variation
  • transparency
  • metadata
  • compression mode
  • quality settings
  • whether the source was already optimized

A 2400-pixel product photo has different compression behavior from a small transparent logo. A screenshot with text behaves differently from a landscape photo. That is why format comparisons should be tested on real project images instead of relying only on generic percentages.

Lossy WebP Reduces Less Visible Detail#

Lossy WebP is commonly used for photographs and marketing images. Like JPEG, it reduces file size by approximating some visual information. The aim is to discard detail that is less important to perceived quality while preserving the parts people are likely to notice.

When lossy WebP works well, the output looks close to the source at normal viewing size and uses fewer bytes. When pushed too far, artifacts can appear:

  • banding in smooth gradients
  • smeared texture
  • rough edges around high-contrast areas
  • blocky detail
  • poor text readability in screenshots

The right quality setting depends on the asset. A product close-up may need a higher setting than a decorative thumbnail. A hero image may need more careful review than an image buried deep in a page.

Google's WebP compression documentation explains that WebP supports lossy and lossless compression and describes the encoder tools behind common workflows.

Lossless WebP Finds Repetition#

Lossless WebP takes a different approach. It aims to preserve the image information while representing it more efficiently. This can work well for logos, UI screenshots, diagrams, and transparent graphics, especially when there are repeated colors or patterns.

Lossless WebP is not automatically smaller than PNG. Some PNG files are already highly optimized, and some tiny images have too little data for a new format to improve meaningfully. A lossless WebP can also be larger than a lossy WebP because it is preserving more information.

Use lossless WebP when visual precision matters. Test it against PNG instead of assuming either format wins.

There is also a tool boundary worth making explicit. The WebP format supports lossy and lossless compression, but the GetWebP CLI conversion workflow exposes automatic WebP quality and fixed --quality values rather than a separate "make this lossless" switch. A high quality number is not the same as lossless. If exact text edges, flat artwork, or legal/brand marks need pixel-level precision, keep PNG or SVG available or use an explicit lossless workflow outside this batch conversion path.

Transparency Changes the Tradeoff#

One reason WebP became useful for web teams is that it can support transparency. JPEG cannot. PNG can, but it may be large for some transparent raster assets.

For transparent images, quality review should include the real backgrounds where the image appears. A cutout or logo may look fine on white and show rough edges on a dark page section. If the asset has sharp edges, test lossless WebP and PNG side by side.

If the original artwork is vector, SVG may be the better choice. Raster formats like WebP and PNG are useful after artwork becomes pixels; they do not replace vector source files.

MDN's image file type guide is a helpful reference for comparing when JPEG, PNG, WebP, AVIF, GIF, and SVG fit different web use cases.

Why Results Vary#

Two images with the same dimensions can produce very different WebP results. A flat illustration with a few colors, a noisy camera photo, and a screenshot of a dense interface all contain different kinds of information.

Expect WebP to vary when:

  • the source is already heavily compressed
  • the file is very small
  • the image contains small text
  • the asset has transparency
  • the image has noise or fine texture
  • the output mode changes from lossless to lossy
  • metadata is preserved or removed differently

This is normal. A good workflow records outcomes instead of hiding exceptions. If a WebP file gets larger, keep the original or try a different setting.

For a project batch, capture the conversion result instead of relying on memory:

mkdir -p ./reports
getwebp ./size-sample --recursive --output ./size-review --json > ./reports/size-review.ndjson

Then extract the fields that explain why a file should stay, change settings, or ship:

jq -r '
  select(.type == "convert.completed")
  | .data.results[]
  | [
      .status,
      .file,
      .outputPath,
      .originalSize,
      .newSize,
      .savedRatio,
      .quality,
      .qualityMode,
      (.error // "")
    ]
  | @tsv
' ./reports/size-review.ndjson

In this command, omitting --quality lets the CLI use its automatic WebP quality selection. Use fixed --quality runs only when you are building a deliberate comparison ladder. A negative savedRatio means the WebP output is larger than the source; treat that as a review item, not as a failure to hide. The CLI command and JSON event shape are documented in the command reference and JSON output reference.

Smaller Files and Page Performance#

Smaller image files can help pages load faster because the browser downloads fewer bytes. That can be especially valuable for mobile users, image-heavy pages, and large hero images.

But file format is only one part of image performance. A WebP file can still hurt loading if it is too large in dimensions, discovered too late by the browser, lazy-loaded when it should be prioritized, or served without useful caching.

The web.dev guide to optimizing Largest Contentful Paint is useful because it explains how important page images fit into the broader loading path.

How to Judge Quality#

Use a practical review method:

  1. Keep the original file.
  2. Convert to WebP with a starting quality setting.
  3. Compare file size and dimensions.
  4. Open the image in the page where it will appear.
  5. Check sensitive areas: faces, product texture, text, logos, gradients, and transparency edges.
  6. Keep notes for files that should stay JPEG, PNG, SVG, or AVIF.

Do not decide from a thumbnail preview. Compression artifacts often appear in areas that matter only in context.

For recurring work, store the NDJSON report beside the source set or ticket. The report gives reviewers the actual outputPath, selected quality, qualityMode, and byte delta so the final decision is traceable instead of based on a vague "looks fine" note.

A Realistic Expectation#

WebP can often reduce file size while keeping quality acceptable for web use. It is especially useful for photos, thumbnails, product images, and many transparent raster assets. It is less useful when the source is already tiny, already optimized, vector-based, or visually sensitive in a way that compression damages.

That is the reason WebP belongs in modern image workflows: it provides a strong default candidate, not a promise that every file will improve. The best results come from testing real files, preserving originals, and accepting that some images should remain in another format.

Jack avatar

Jack

GetWebP Editor

Jack writes GetWebP guides about local-first image conversion, WebP workflows, browser compatibility, and practical performance checks for teams that publish images on the web.