PNG Background Adder

Uploads a PNG and alpha-blends every pixel over a chosen solid background color, producing a fully opaque image the same size as the source — useful anywhere transparency isn't supported or a solid backdrop is wanted — then lets you download the result. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool flattens a PNG's transparency onto a solid background color, entirely client-side, turning any transparent or semi-transparent areas into fully opaque pixels.

It's the everyday fix for a transparent-background PNG that needs to sit on a solid backdrop.

What Is PNG Background Adder?

A client-side PNG background compositor that reads an uploaded image's pixel data and alpha-blends every pixel with a chosen RGB background color, producing a fully opaque result the same size as the source.

Opaque source pixels pass through unchanged; transparent and semi-transparent pixels are blended proportionally to their original alpha.

How PNG Background Adder Works

For every pixel, the tool computes its alpha as a fraction (0 to 1), then mixes the pixel's own RGB color with the background color weighted by that fraction and its complement.

The output pixel's alpha is always set to fully opaque, since after this blend there's no remaining transparency to represent.

When To Use PNG Background Adder

Use it before exporting to a format or context that doesn't support transparency, standardizing a batch of logo PNGs onto a brand background color, or simply giving a transparent icon a visible backdrop for a preview.

It's also useful for testing how a transparent asset will look against different background colors.

Features

Advantages

  • Runs entirely client-side; the uploaded image is never sent to a server.
  • Correct alpha-weighted blending, not a naive overwrite, so semi-transparent edges look natural.
  • Keeps the output at exactly the same dimensions as the source.

Limitations

  • Only a single flat color is supported as the background; gradients or image backgrounds aren't available here.
  • Once flattened, the original transparency information is gone from the output — keep the source file if you might need it transparent again.

Examples

Put a transparent logo on white

Input

A 300x100 transparent-background PNG, white background

Output

A 300x100 fully opaque PNG with the logo on a white backdrop

The most common use case: preparing a logo for a context that requires a solid background.

Preview an icon against brand color

Input

A 64x64 transparent icon, background #1a73e8

Output

A 64x64 opaque PNG with the icon composited over that blue

A quick way to check how an icon reads against a specific brand color.

Best Practices & Notes

Best Practices

  • Check the transparency checker tool first if you're unsure whether your source PNG actually has transparent areas worth flattening.
  • Pick a background color that matches the final destination (e.g. your site's actual background color) for an accurate preview.

Developer Notes

addBackgroundToPng is a pure lib function operating on a plain Uint8ClampedArray PixelBuffer: it applies the standard 'over' alpha blend per pixel against a flat RGB color and forces output alpha to 255 — no DOM access until the component paints the flattened buffer to a canvas.

PNG Background Adder Use Cases

  • Preparing a transparent logo for a context that requires an opaque image
  • Standardizing a batch of icon PNGs onto one consistent background color
  • Previewing how a transparent asset looks against different backdrop colors

Common Mistakes

  • Flattening a PNG and then losing the original transparent version — always keep a backup of the source file.
  • Expecting the output to still be transparent; flattening intentionally removes all transparency.

Tips

  • Use a background color matching your final destination page/app for the most representative preview.
  • If you need transparency back later, re-run your original edits on the untouched source file rather than trying to un-flatten this output.

References

Frequently Asked Questions