Started by seb, March 14, 2011, 04:42:33 PM
QuoteIf an alpha channel is used in an image, it is common to also multiply the color by the alpha value, to save on additional multiplications during compositing. This is usually referred to as premultiplied alpha. Thus, assuming that the pixel color is expressed using RGBA tuples, a pixel value of (0.0, 0.5, 0.0, 0.5) implies a pixel which is half green and has 50% coverage. (Explanation: The RGB values are the first three values, (0, 0.5, 0) and the alpha value is the fourth, 0.5. If the color were fully green, its RGB would be (0, 1, 0). Since this pixel is using a premultiplied alpha, all of the RGB values in the ordered triplet (0, 1, 0) are multiplied by 0.5 and then the alpha is added to the end to yield (0, 0.5, 0, 0.5).) Premultiplied alpha also has some advantages over normal alpha blending because premultiplied alpha blending is associative and linear interpolation gives better results.