Image transparency
Transparency tells a compositor how an image contributes over a background, using alpha or a format-specific transparent index rather than an ordinary background colour.
A logo placed on a dark page can carry an unexpected white rectangle. The white pixels may be part of the image, while the intended design needed transparent background positions.
Transparency describes how the source contributes to a composition. A checkerboard in an image editor is usually a visualization of transparent regions, rather than the background that every viewer will receive.
Coverage changes the result over each background
For an opaque destination, a straight-alpha blend in a declared numerical domain is:
result = alpha × source + (1 − alpha) × background.
Take a white source sample with value 1 and coverage 0.25:
| Background sample | Calculation | Result |
|---|---|---|
| 0, black | 0.25 × 1 + 0.75 × 0 | 0.25 |
| 0.4, gray | 0.25 × 1 + 0.75 × 0.4 | 0.55 |
| 1, white | 0.25 × 1 + 0.75 × 1 | 1 |
The same image edge therefore produces different final pixels on different backgrounds. This is arithmetic in the stated working domain; perceptual display brightness also depends on colour encoding.
A transparent index and an alpha channel have different scope
An indexed format can designate an entry as transparent. GIF's transparent index leaves those destination positions unchanged. It does not provide arbitrary fractional coverage for each palette colour.
An alpha-capable image can retain intermediate values around an antialiased edge. PNG's colour samples are stored unassociated with alpha. A processing buffer may use premultiplied samples instead, so the decoder/compositor boundary must preserve the convention.
The subtitle overlay example develops the corresponding straight/premultiplied calculations. They apply to image layers as well as captions.
Flattening commits to a background
Flattening the white edge above onto black produces a gray sample of 0.25. Saving that result without alpha makes the gray edge permanent. Placing it on a white page later cannot recover the original white source and its coverage from that single value.
This is why an Emby logo and a rectangular photographic backdrop have different image requirements. The intended layer needs useful alpha through the source, any generated derivative and the app's composition.
Resizing introduces another boundary. Filtering colour and alpha inconsistently can pull hidden background colours into the edge and create a fringe. A suitable process keeps their relationship coherent, then encodes the result in the output format's required convention.