Skip to content

Premultiplied alpha and straight alpha with a free math lab

Compare straight and premultiplied alpha, see why double multiplication darkens edges, and export an original SVG comparison and numeric JSON from a free lab.

FREE ALPHA MATH LAB

Compare straight and premultiplied alpha

Known source colors and one pixel opacity · Original numeric study

Four alpha-association cases at 50% opacity

Straight RGB 56 136 232 · Premultiplied RGB 28.00 68.00 116.00

The two correctly associated formulas produce the same numeric result

Straight formula
RGB 152.00 193.00 242.00
Premultiplied formula
RGB 152.00 193.00 242.00
Alpha multiplied twice
RGB 138.00 159.00 184.00
Straight treated as premultiplied
RGB 180.00 255.00 255.00

This lab does not inspect image files or detect alpha conventions · It compares association in the same chosen numeric RGB space, without color-managed linear-light rendering

Original pixel math comparison of matching straight and premultiplied formulas with two mismatched interpretations

A transparent image can look correct on one background and develop a dark fringe in another application. Before changing the matte, check how the color and alpha are interpreted. Premultiplied alpha and straight alpha describe the relationship between those values, not whether the visible subject is a good selection.

For a repeated transparent surface image, use the tileable texture inspector to review joins and preserve the source alpha.

What premultiplied alpha means

With straight or unassociated alpha, the stored color has not already been multiplied by opacity. With premultiplied or associated alpha, it has. A color value of 200 at one-half opacity becomes 100 in the premultiplied representation, before adding the background contribution.

The W3C compositing specification sets out source-over alpha compositing. For an opaque background, the association examples here compare the same foreground and background values in the same numeric space. Color-space conversion is a separate decision; the lab is not a color-managed linear-light renderer.

Compare the four cases in the lab

Choose a foreground color, background color and opacity. The first two rows use their matching representations: straight color multiplied once, or already-premultiplied color added without multiplying it again. Their numeric results match. The last two rows deliberately use the wrong interpretation so you can see the consequence.

CaseOpaque-background expressionExpected behavior
Straight inputC × A + B × (1 − A)Matches the associated result
Premultiplied inputP + B × (1 − A), where P = C × AMatches the straight result
Alpha multiplied twiceP × A + B × (1 − A)Can darken partial-opacity color
Straight treated as premultipliedC + B × (1 − A)Can become too bright and clip

The swatches are calculated opaque output colors for one pixel. They are not samples measured from an uploaded file. Download the current SVG and numeric JSON to keep the selected inputs and results together, or inspect the original calculation source.

Why a PNG is not a premultiplied-file detector

The PNG specification states that PNG color samples are not premultiplied by alpha. Software can still use premultiplied representations internally while decoding, filtering or displaying an image. A canvas preview does not reveal every internal buffer convention or the original settings of another application.

Do not diagnose a file solely from a dark edge. A black matte baked into the color, an inaccurate cutout, resampling, color management or an incorrect interpretation can produce different problems. Inspect the original image and the settings in the application where the fringe appears.

Use a controlled edge test

  1. Keep an untouched copy of the source and note its format.
  2. View the edge against contrasting light and dark backgrounds.
  3. Check the application's source interpretation and alpha handling.
  4. Compare a small known test before changing an entire sequence.
  5. Export and re-import the result into the intended destination.

Change one setting at a time. If an interpretation correction fixes the fringe without changing the silhouette, retain the source and record that setting. If the shape itself is missing detail, address the matte separately using the rotoscoping and matte-review workflow.

Understand the zero-alpha limit

When opacity is greater than zero, an ideal unpremultiply operation divides the associated color by opacity. At zero opacity, that division cannot recover a unique original color. The lab returns a null recovered value at zero rather than inventing a color from missing information.

Near zero, quantization and rounding can also matter. Small associated values have limited precision in a finite-bit representation. Keep higher-quality source material when the pipeline requires it and inspect the actual export rather than assuming every conversion is reversible byte for byte.

Keep the tasks in the right order

For an AI-generated character or product, approve the source image in Clout Image and Video, then use suitable editing tools for selection and compositing. A transparent-looking background in a preview is not proof of a usable alpha channel.

The light-wrap tool changes inside-edge color while preserving the selected PNG alpha. It is a different finishing step from correcting association. The image-sequence converter flattens alpha onto a chosen background for its MP4 output; retain the original PNGs for later compositing.

Sources and testing

Official sources checked October 24, 2026. Original Clout drawings, numeric studies and planning resources. The sequence tool encodes user-selected PNGs locally; no generated in-between frames, ShotVerse inference or independent model benchmark is claimed.

Questions, answered

Frequently asked questions

What is premultiplied alpha

It stores color values already multiplied by opacity. The matching compositing expression must not multiply that color by alpha again.

What is straight alpha

Straight or unassociated alpha stores color independently of opacity, so the color contribution is multiplied by alpha during compositing.

Is a PNG stored with premultiplied alpha

The PNG specification uses non-premultiplied color samples. Software may use associated representations internally while processing it.

Can the lab detect the alpha type of my image

No. It compares known numeric inputs and does not inspect image files.

Can unpremultiply recover color at zero alpha

No unique original color can be recovered from zero associated color at zero alpha. The lab returns null for that recovery case.