The right maths for light
Footage and photographs of light — a sparkler, a candle flame, embers, a lens flare, a light leak, smoke lit from the side — are shot on black because black is what light adds to. Getting them onto another picture is a question of turning that addition into transparency. A tolerance key cannot: it decides per pixel between keep and remove, and the soft outer edge of a glow is neither.
Unmultiply is the inverse of the addition. The brightest channel of each pixel becomes its alpha, and the colour is divided by it. A dim orange edge becomes a bright orange at low opacity, which over a white page reads as a faint warm haze and over a night sky reads as the glow it was. Toggle the preview between nothing, white, grey and a made background to see the edge on each.
Limits
- Dark parts of the subject become transparent too. Unmultiply is for light; a person photographed against black needs the background remover.
- Pure white highlights stay fully opaque white, which is correct for light but can look flat where the original was clipped.
Questions people ask
- Why does a normal background remover leave a dark rim on fire and sparks?
- Because the edge of a glow is not partly glow and partly background — it is the glow at partial strength, added to black. Cutting out the black with a tolerance keeps those dim pixels at full opacity, and dim at full opacity is dark. The fix is to treat the picture as light added over black: alpha comes from brightness and the colour is divided back out, so a dim edge becomes a bright colour at low opacity.
- What is unmultiply, exactly?
- For each pixel the alpha is its brightest channel and the colour is divided by that alpha. Put the result back over black and you get the original pixel exactly; put it over white or a photo and the light lands with no fringe. It is the same arithmetic as a screen blend, written into the file so it works anywhere a PNG goes.
- When should I use the hard key instead?
- When the black is a box behind a solid graphic — a logo exported on black, a screenshot of a dark interface. There you want the black gone and everything else fully opaque, which is what the hard key does, with a softened edge.
- What does 'lift the black floor' do?
- Camera black is rarely zero; sensor noise leaves values of three or four. The floor maps everything at or below it to fully transparent so the PNG is not covered in faint speckle, and rescales the rest so the brightest light is unchanged.
- Is anything uploaded or downloaded?
- Neither. This is arithmetic on the pixels, done in the page, so it is instant and works without a model.
Other background jobs
- Remove white backgroundThe white box around a logo gone, the white inside it kept. No model.
- Logo backgroundA flat background out with the holes in the letters kept, then icon, avatar and one-colour sizes.
- Transparent backgroundA PNG with a real alpha channel, for logos, products and stickers.
- Background makerA gradient, grain field or flat colour drawn at any pixel size, with its CSS.