An alpha channel alone does not tell a renderer how the accompanying color components are stored. With straight alpha, color values remain unscaled by opacity. With premultiplied alpha, the stored color components already include that multiplication. The two layouts can describe the same translucent image using different numbers.
Read the declared alpha mode
Microsoft’s DXGI_ALPHA_MODE distinguishes premultiplied, straight, ignored and unspecified alpha behavior. In the premultiplied case, each color is scaled by alpha while the alpha value itself is unchanged. In the straight case, the color remains unscaled. An unspecified mode is missing interpretation, not another name for straight alpha. Likewise, ignoring alpha is an explicit processing choice rather than evidence that the underlying channel contains no data.
Work through one component
Take an illustrative red component of 0.8 with alpha 0.25 in a stated working representation. Straight storage keeps red at 0.8 and alpha at 0.25. Premultiplied storage keeps red at 0.2 and alpha at 0.25. Both can contribute the same 0.2 red over black under the matching source-over calculation. This is a normalized arithmetic illustration; actual integer storage needs the corresponding range and rounding rules.
Recognize double multiplication
If the premultiplied red value 0.2 is mistakenly treated as straight and multiplied by 0.25 again, the contribution becomes 0.05. That error can darken partially transparent edges where alpha is between zero and one. A fully opaque center may still look correct, making the edge the more revealing place to inspect. The opposite mismatch can produce excessive contributions. A symptom alone is insufficient; compare stored values and the consuming stage’s declared interpretation.
Keep API inputs distinct from stored pixels
Direct2D documents a useful boundary case: D2D1_COLOR_F brush colors are interpreted as straight alpha even when the destination uses premultiplied storage, and the API performs the translation. Manually premultiplying such an input can therefore duplicate work. Record the contract of each API boundary as well as the bitmap’s storage mode. Converting back by division also requires care at zero alpha, where that operation cannot recover an original unscaled color from zero premultiplied components.
