Skip to content

Add Background to PNG

Replace PNG transparency with an exact solid background color locally while preserving the original pixel dimensions.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Choose a transparent or partly transparent PNG up to 25 MiB.
  2. 2.Select the solid background color that matches the final destination, then choose Add background.
  3. 3.Inspect the opaque preview and download the PNG with its original pixel dimensions.

About Add Background to PNG

Add Background to PNG replaces transparent and partly transparent pixels with a solid color without uploading the source file. Choose a PNG, select any color with the browser color control, and create a new opaque PNG at the same width and height. The result includes an on-page preview, exact output dimensions, file size, and a direct download. It is designed for the common moment when a logo, product cutout, signature, icon, or exported design has transparency but the destination requires a normal solid background.

The tool accepts PNG only because transparency is the purpose of this workflow. A JPEG does not contain an alpha channel, while other browser-decodable formats can have inconsistent transparency and metadata behavior across applications. Keeping the input contract narrow makes the output predictable: the browser decodes one PNG, composites every pixel over one selected color, and exports one PNG. The original file is never changed. The downloaded filename adds “-background” so it remains easy to distinguish from the transparent source.

Partly transparent edges receive the same treatment as fully transparent areas. This matters around anti-aliased text, soft shadows, hair, rounded icons, and feathered cutouts. Simply replacing pixels whose alpha is zero would leave translucent edge pixels visually tied to the old backdrop. Instead, each source color contributes according to its alpha and the selected background contributes the remaining share. The output alpha is then set to fully opaque. This is standard source-over compositing with an opaque backdrop, not a threshold or a rough transparency mask.

For example, a half-transparent red pixel over blue becomes a purple mixture rather than solid red or solid blue. A fully opaque source pixel remains unchanged, and a fully transparent pixel becomes exactly the chosen background color. The implementation is checked against external golden cases covering zero alpha, full alpha, values immediately above and below one half, representative channel mixtures, and the lowest nonzero alpha step. Channel results are rounded to ordinary 8-bit integers for the exported PNG.

The canvas retains the source pixel dimensions. It does not crop, resize, sharpen, denoise, or compress the image toward a target file size. If the destination needs different dimensions, add the background first and then use Image Resizer. If it needs JPEG, download the opaque PNG and use PNG to JPG. Separating those operations keeps each result understandable and prevents a background change from silently altering geometry or lossy quality.

Processing is bounded to 16 megapixels and 12,000 pixels on either edge. That limit protects the browser from unusually large decoded pixel buffers, which can consume much more memory than the compressed file size suggests. Files may be up to 25 MiB before decoding. A file with a PNG extension but invalid bytes produces a clear decode error. The browser color input supplies a six-digit hexadecimal value, and the logic validates that value before processing.

Everything happens in the current tab. A temporary local Object URL is used for preview and is released when the image changes or the page closes. Pixel data is read from an in-memory canvas, composited, and exported through the browser. No image, color choice, or result is sent to Lizely. This makes the tool useful for confidential drafts and private product images, though you should still follow your organization’s local-device policies.

Use a background chosen for the real destination rather than guessing from a checkerboard preview. White is common for marketplaces and documents, but social graphics, dark interfaces, print layouts, and brand systems may require a specific HEX value. After download, inspect soft edges against the destination color at normal viewing size. This tool produces a technically defined composite; it does not certify brand compliance, print color matching, marketplace acceptance, or accessibility contrast.

Methodology & sources

For each decoded RGBA pixel, source RGB is multiplied by source alpha and the selected opaque background RGB is multiplied by one minus source alpha. The contributions are added, rounded to 8-bit channels, and output alpha is set to 255. Dimensions are unchanged and processing is capped at 16 megapixels.

Frequently asked questions

Does this preserve semi-transparent edges?
Yes. Every source pixel is alpha-composited over the selected color, so soft edges and shadows blend instead of being treated as only transparent or opaque.
Will the image dimensions change?
No. The output canvas uses the exact source width and height. Use Image Resizer separately if the destination needs another size.
Why does the tool accept only PNG?
The tool is specifically for replacing PNG transparency. A narrow input contract avoids implying that every browser image format preserves alpha and metadata in the same way.

Image Tools guides

View all