What is Premultiplied Alpha?

Premultiplied alpha stores color components after multiplying them by the pixel’s alpha value. Straight, or unassociated, alpha stores the color components separately from opacity.

How Premultiplied Alpha works

With normalized component values, straight red at 50% opacity is RGB (1, 0, 0) with alpha 0.5. Its premultiplied representation is RGB (0.5, 0, 0) with the same alpha. Compositing formulas must use the corresponding representation. Converting back divides color by alpha where alpha is nonzero; at zero opacity, the original hidden color cannot be recovered from premultiplied zero values. Integer storage, such as 8 bits per channel, rounds premultiplied colors more coarsely as alpha decreases, so round trips can lose precision even at nonzero alpha. Avoid repeated conversions.

Key facts

  1. Multiplying an already premultiplied color by alpha again darkens it. Treating premultiplied values as straight can therefore create visible edge errors.
  2. The alpha convention and the color space used for filtering or blending are separate choices. Matching one does not establish the other.
  3. A file format’s alpha storage convention can differ from the decoded buffer exposed by a library. Check the API contract at each boundary.

When Premultiplied Alpha matters

Identify which alpha convention an image buffer or graphics API expects before compositing or filtering it. Convert deliberately at boundaries to avoid dark fringes or incorrectly bright translucent edges.

Sources

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free