Alpha channels and image matting explained

Last reviewed 2026-09-17. Every competitor figure links to the vendor's own page.

An alpha channel stores how opaque each pixel is, from fully transparent to fully solid. A binary mask allows only those two extremes. A true matte allows everything in between, which is what makes hair, glass and soft fabric look natural rather than cut out with scissors.

Mask versus matte

The same subject, represented two ways.
Binary maskTrue matte
Values per pixel2 (keep or discard)256 (8-bit opacity)
Hair and furChewed or clumpedIndividual strands survive
Glass and smokeSolid or goneCorrectly semi-transparent
Edge appearanceHard, often stair-steppedSmooth, naturally blended
Compute costLowHigher
Typical useSimple shapes, fast previewsPhotographic subjects

Why the edge pixel is the whole problem

Consider a single pixel sitting on the boundary of a shoulder. In the original photograph it is genuinely part subject and part background, and its recorded colour is a blend of the two. Extracting the subject means answering two questions at once: how much of this pixel is subject, and what colour was the subject part before the background was mixed in.

One equation, two unknowns. This is why matting algorithms rely on priors learned from data rather than solving directly, and why results differ so much between tools on exactly the subjects people care about most.

Straight versus premultiplied alpha

Two conventions for storing colour alongside opacity.
Straight (unassociated)Premultiplied (associated)
Colour channels storeOriginal colour, unscaledColour already multiplied by alpha
CompositingMultiply at composite timeAdd directly
Mismatch symptomBright or fringed edgesDark halo around subject
Common inPNG files, most editorsVideo and compositing pipelines

If a cutout looks correct in one application and shows a dark rim in another, the two are almost certainly disagreeing about which convention the file uses. The file is fine; the interpretation is not.

Practical implications

  • Judge a background remover on hair and soft edges, since that is where matting quality actually shows
  • Keep the PNG master; every flatten to JPEG destroys the matte irreversibly
  • A dark edge appearing only in one program is a convention mismatch, not a bad cutout
  • Higher source resolution gives the matting algorithm more partial-coverage pixels to work with

Frequently asked questions

What is an alpha channel?

A fourth channel alongside red, green and blue that records opacity per pixel. In an 8-bit alpha channel each pixel gets a value from 0 for fully transparent to 255 for fully opaque, so partial coverage can be represented exactly.

What is the difference between a mask and a matte?

A mask is binary: each pixel is either kept or discarded. A matte is continuous, allowing partial opacity. Matting is harder to compute but is the only way to represent a strand of hair that covers 40 percent of a pixel.

Why do cutouts sometimes have a dark edge?

Usually premultiplied alpha being treated as straight alpha, or the reverse. In premultiplied alpha the colour channels are already scaled by opacity, so compositing them again darkens the edge. It is a pipeline mismatch rather than a model failure.

Why is matting hard for AI models?

A mask needs one binary decision per pixel. A matte needs a continuous opacity estimate plus an estimate of the pixel's true colour separated from the background it was blended with. That is mathematically underdetermined, which is why matting quality varies more between tools than masking does.

Which formats store an alpha channel?

PNG, WebP and AVIF store a full 8-bit alpha channel. GIF stores one bit, meaning on or off only. JPEG stores none at all, so saving a cutout as JPEG discards transparency permanently.

Related