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
| Binary mask | True matte | |
|---|---|---|
| Values per pixel | 2 (keep or discard) | 256 (8-bit opacity) |
| Hair and fur | Chewed or clumped | Individual strands survive |
| Glass and smoke | Solid or gone | Correctly semi-transparent |
| Edge appearance | Hard, often stair-stepped | Smooth, naturally blended |
| Compute cost | Low | Higher |
| Typical use | Simple shapes, fast previews | Photographic 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
| Straight (unassociated) | Premultiplied (associated) | |
|---|---|---|
| Colour channels store | Original colour, unscaled | Colour already multiplied by alpha |
| Compositing | Multiply at composite time | Add directly |
| Mismatch symptom | Bright or fringed edges | Dark halo around subject |
| Common in | PNG files, most editors | Video 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.