Fill Transparent WebP

Fill transparent areas in a WebP with a solid colour - side-by-side preview, quality slider. Free, offline, client-side, instant and secure.

Upload a WebP (or PNG / JPG / GIF). Pick a background colour. The tool composites your image over a solid fill - fully-transparent pixels become the colour, fully-opaque pixels are untouched, and semi-transparent edges blend cleanly. Side-by-side preview, output quality slider, real pixel-counts in the stats line.

92%
- upload an image to begin

Original (transparency shown on checkerboard)

No image yet

Filled (alpha composited over fill colour)

No image yet

How to Use Fill Transparent WebP

  1. Upload or drop an image - WebP, PNG, JPG, or GIF. Max 20 MB. Decoded locally, never uploaded.
  2. Pick a fill colour in the colour picker. The default is white. Changes are debounced (120 ms) so dragging in the picker doesn't redraw constantly.
  3. Adjust the WebP quality 1-100. 92 is a sensible default - high quality at small file size. Lower values shrink the file at the cost of noticeable artefacts; 100 is lossless on browsers that support it.
  4. Watch the side-by-side preview update. Left panel is the original on a checkerboard (so you can see what's transparent). Right panel is the filled output on the same checkerboard (so you can verify there's no transparency left).
  5. Read the stats line. Source dimensions, exact transparent / semi-transparent / opaque pixel counts and percentages, output WebP quality, output file size.
  6. Click Download filled WebP (or press Ctrl/Cmd + Enter). Saves as <original>-filled.webp. Reset clears the controls; Clear drops the image entirely.

Frequently Asked Questions

What does “alpha compositing” actually do here?

For each source pixel with colour (Rs, Gs, Bs) and alpha As (0-255), and a fully-opaque background (Rb, Gb, Bb), the output is (t·Rs + (1−t)·Rb, t·Gs + (1−t)·Gb, t·Bs + (1−t)·Bb, 255) where t = As / 255. Fully transparent (t=0) → output is the background. Fully opaque (t=1) → output is unchanged. Semi-transparent → smooth linear blend. No premultiplied-alpha gotchas because getImageData returns straight (unpremultiplied) values.

Why would I want to fill transparency?

Several platforms still don’t render alpha well – older email clients, some chat thumbnails, certain print pipelines, and most fax-style export formats. Filling transparency with the destination background colour ensures the icon looks intentional everywhere instead of “this used to have a checkerboard”. The output WebP is still smaller than a PNG-fill alternative.

Does the output preserve image quality?

The opaque pixels round-trip exactly (RGB unchanged). Semi-transparent pixels are blended once into RGB at full opacity – that’s a lossy operation by definition (you’ve discarded the alpha). The WebP encoder may further compress depending on the quality slider. Use quality 100 for the visually-lossless output; lower values trade quality for file size.

What happens to semi-transparent edges?

They blend proportionally with the fill colour. An anti-aliased dark-blue logo edge on a white fill (50% alpha) gives a medium-blue pixel – exactly what compositing on a real white background would produce. No haloing as long as the source’s anti-aliasing was correct against transparency.

Can I fill with a gradient?

Not in this tool – single solid colour only. For a gradient fill, do it in two stages: fill with one anchor colour here, then load the result into an editor (Photoshop, GIMP, even a CSS preview) and overlay a gradient on a separate layer. Doing gradient fills correctly with anti-aliased edges needs per-pixel destination colour, not the single hex value the picker takes.

What’s the output quality slider for?

It’s the quality argument passed to canvas.toBlob('image/webp', q). 1 = maximum compression (large artefacts), 100 = highest quality (largest file, often visually lossless). Default 92 is the recommended “looks the same as the source to most eyes” trade-off. The stats line shows the output file size so you can sweep the slider and pick a good point.

Does this work with animated WebP?

No – only the first frame is processed. The browser’s Image() decode treats an animated WebP as its first frame for canvas use, so subsequent frames are discarded. For animated WebP transparency filling, you need a frame-by-frame pipeline (libwebp’s webpmux is the standard tool).

What image sizes are supported?

20 MB upload cap. Practical canvas limit is ~16,384 px per side. The composite is O(pixels) – a 4K image (~8M pixels) processes in under 100 ms; WebP encoding may take another 100-500 ms depending on the browser. Stats line surfaces final encoded size so you know what was paid.

Is my image uploaded anywhere?

No. The page is three static files (HTML, CSS, JS) and runs entirely in the browser via the File API, Canvas, and Blob APIs. No fetch, no XHR, no analytics, no cookies. You can disconnect from the internet after the page loads and the tool keeps working.