Skip to content
UniKit

Add background colour

Put a colour behind an image: whole-image or a specific rectangle, with adjustable opacity — a semi-transparent fill blends with the original pixels. Exports PNG or JPEG.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Images are processed locally in your browser with Canvas and never uploaded.

Pick an image first (PNG / JPEG / WebP / GIF all work).

Result

No result yet

100

Result details

These are the real numbers from this run — copy them straight out.

Pick an image and set the options; sizes, pixel count and export size show up here.

What this tool does

  • Put a white background behind a transparent PNG for platforms that reject alpha (many e-commerce backends do).
  • Add a semi-transparent grey behind a dark screenshot so white text stays readable on a light page.
  • Colour just one area: tick "Region only" and fill in x / y / width / height; every other pixel is untouched.
  • Build a comparison: the same image on a black and a white background to check icon contrast in both themes.

Example

Input

A 2×2 image (transparent top-left, pure red bottom-right), colour #ffffff, opacity 50%, whole image

Output

All four pixels are blended: the transparent one becomes (128, 128, 128, 255) and the red one becomes (255, 128, 128, 255)

Straight from addBackground: at 100% opacity the colour is written directly with alpha forced to 255; below that it blends proportionally. Pixel count and canvas size never change.

Frequently asked questions

Does adding a background change the image size?

No. Only pixel colours are rewritten; the canvas size and pixel count stay identical, so the output is never larger than the input.

How is a semi-transparent fill computed?

Per channel as `original × (1 − opacity) + colour × opacity`, with alpha taken as the larger of the two. A 50% white fill therefore turns red into (255, 128, 128).

Can it fill several areas at once?

No — one rectangle per run. Repeat the operation, or pre-process with the mosaic/region tools and merge afterwards.

Why is the JPEG export opaque?

JPEG has no alpha channel at all. With opacity at 100 it makes no difference; choose PNG when transparency matters.

Keywords:add background colourimage backgroundfill backgroundregion backgroundsolid behind image

Related tools