Straight vs Premultiplied Alpha: Why Video Edges Look Wrong

Last updated: · Written by the RenderAlpha team

A transparent video edge can be stored in two ways, and every player, editor and browser has to assume one of them. When the assumption does not match the file, you get a halo that no amount of re-exporting removes.

Short answer

Straight (unpremultiplied) alpha stores the full-color pixel plus a separate opacity value; premultiplied alpha stores the color already multiplied by that opacity. Both represent the same edge, but each needs its own compositing formula. Composite one with the other’s formula and the semi-transparent rim is computed twice or not at all — that is the bright or dark fringe you see. The fix is interpretation, not re-rendering.

The same transparent pixel, stored two ways

Take one subject color, RGB (200, 40, 40), and one edge pixel that is a quarter opaque: alpha 64 of 255. Straight alpha keeps the color as it is and records the opacity next to it: stored RGB (200, 40, 40), alpha 64. Premultiplied alpha stores the color already scaled by the opacity: (200, 40, 40) × 64⁄255 = (50, 10, 10), with the same alpha 64. The W3C Compositing and Blending spec defines both paths: straight colors composite as co = Cs·αs + Cb·(1 − αs), premultiplied values as co = cs + Cb·(1 − αs), where cs is the already-multiplied color.

Neither storage is wrong. Premultiplication is what most compositing hardware does per pixel anyway; straight storage keeps the original color readable at every opacity, which is what most editing apps want from imported footage. The failure only happens when data stored one way is composited with the other formula. If you are new to the alpha channel itself, start with what a video alpha channel contains.

One test strip, four composites

We built one synthetic edge — subject (200, 40, 40) over background (40, 40, 200), with a five-pixel alpha ramp of 0, 64, 128, 192, 255 — and composited it four times: each storage with each formula. The build is a 17-line Pillow script kept in our source tree, so every number below is reproducible. The two diagonal combinations are mathematically identical and correct; the two off-diagonal ones are the fringes.

Strip: straight-stored edge composited with the straight formula, clean edge
Straight data, straight formula — correct. Stored RGB (200, 40, 40), alpha ramp.
Strip: premultiplied edge composited with the premultiplied formula, identical clean edge
Premultiplied data, premultiplied formula — pixel-identical to the strip above.
Strip: straight data composited as premultiplied, bright washed halo on the edge
Straight data composited as premultiplied — the background is added twice and the rim glows.
Strip: premultiplied data composited as straight, dark muddy edge
Premultiplied data composited as straight — the dimmed stored color shows through as a dark rim.
AlphaCorrect (both diagonals)Bright fringe: straight data, premult formulaDark fringe: premult data, straight formula
040, 40, 200 (= background)240, 80, 24040, 40, 200
6480, 40, 160230, 70, 19043, 32, 152
128120, 40, 120220, 60, 14070, 30, 110
192160, 40, 80210, 50, 89124, 32, 72
255200, 40, 40 (= subject)200, 40, 40200, 40, 40

Reading the fringe: bright means one thing, dark means the other

The numbers give you a diagnosis rule that works without knowing how the file was made. A rim that is brighter and washed-out than the surrounding background — 230, 70, 190 where 80, 40, 160 is correct — means fully-colored pixels were composited as if already dimmed, so the background contribution was added twice. A rim that is darker and muddier — 43, 32, 152 — means already-dimmed pixels were multiplied by alpha again. Fully opaque and fully transparent pixels (alpha 255 and 0) match in all four columns, which is why the damage hides in soft edges like hair and motion blur, exactly where video background removal is hardest.

How to tell which one a file uses

You cannot read the storage off the file header in the common cases; you test what a compositor does with it. The quickest check with our tools:

  1. Open the file in the free transparent video checker and sample a soft edge on the black and the white background in turn. A rim that changes character between the two backgrounds — glowing on one, muddy on the other — is an interpretation mismatch in that browser, and the checker says so in plain words.
  2. In a player or editor, place the clip over a solid mid-gray. Both mismatches are easiest to see against a neutral background; against black or white one of the two fringes nearly disappears.
  3. If the file came out of an editor, check the alpha interpretation setting at import — After Effects’ straight-versus-premultiplied (matted) choice is documented by Adobe and covered with sources in our alpha-channel export guide. Changing the interpretation there is instant; re-exporting is not needed.
  4. If the fringe is already baked into the pixels — every composite shows it — no interpretation setting will help. Go back to the source asset and re-export, which is the honest limit we describe in why a transparent video stops being transparent.

What this test does and does not tell you

The strips above are synthetic — one subject color, one background color, a five-step ramp — so the numbers are exact and reproducible, unlike footage where noise and compression sit on top of the math. We did not test Premiere, Final Cut, After Effects, DaVinci Resolve or any player’s import setting on this machine, so we do not claim which assumption each one makes; the Adobe interpretation setting is cited from Adobe’s documentation in the export guide above. FFmpeg exposes the same two worlds explicitly — its premultiply and unpremultiply filters convert between them — which is how we describe the operation in our green screen conversion guide. For what alpha means pixel by pixel, see how a transparent WebM is built.

Frequently asked questions

Can I fix a fringe that is already in the pixels?

No. Once composited, the wrong rim values are ordinary pixels; no interpretation setting recovers the original edge. Fix it at the source: re-export with the correct straight/premultiplied interpretation, or re-run the background removal from the original footage.

Which storage does my export from this site use?

Our transparent WebM exports carry the alpha as side data and we verify the decoded pixels, not a label. The practical test is the free checker on this site: sample an edge on black and white backgrounds and the page reports what the current browser actually composites.

Does a transparent GIF have this problem?

No — GIF transparency is on/off per pixel with no semi-transparent rim, so there is no half-opaque band where the two formulas differ. The trade-offs of GIF edges are covered in making a transparent GIF.

Why does the fringe appear in one app but not another?

Different compositors assume different storage for the same file. A file that looks clean in your editor can show a halo in a browser or OBS if their assumptions differ. That is also why the checker reports per-browser results instead of one verdict.

Sources

Primary sources we checked. The date is when we last opened each page.