What is straight (unassociated) alpha?
Straight alpha, also called unassociated alpha, stores a pixel's color values independently of its opacity, so (255, 0, 0, 128) means pure red at about 50% opacity.
By Rocco Bombardieri · Updated
Explained in more detail
With straight alpha, the red, green and blue values describe the color of the pixel as if it were fully opaque, and the alpha value is stored separately. Nothing is pre-scaled. Change the alpha and the color values stay exactly as they were.
This is how PNG works: its specification defines the alpha channel as unassociated, meaning colour values are not premultiplied by alpha. Canvas getImageData returns each pixel as four values in the order red, green, blue, alpha, though the HTML Standard warns that translucent pixels may not read back exactly as written.
Straight alpha is convenient for editing because it is lossless with respect to color. You can lower a pixel's alpha to 0 and raise it again later and the color is still there. That is exactly what a background removal pass does when it sets alpha to 0 for matching pixels but leaves the color values alone.
The downside appears when an image is scaled or blended. If a fully transparent pixel carries a hidden color, such as black, a naive filter averages that hidden color with its opaque neighbours and creates a dark fringe around the edge. Good software compensates by premultiplying before the filter and converting back afterwards.
Practical rule: keep source images as straight alpha, and convert to premultiplied only inside a renderer that needs it.