{"id":108,"date":"2011-02-27T20:04:20","date_gmt":"2011-02-27T20:04:20","guid":{"rendered":"http:\/\/g100.us\/?p=108"},"modified":"2022-04-29T18:22:12","modified_gmt":"2022-04-29T16:22:12","slug":"premultiplied-alpha-vs-straight-alpha","status":"publish","type":"post","link":"https:\/\/g100.us\/premultiplied-alpha-vs-straight-alpha\/","title":{"rendered":"Quick-Tip: Straight Alpha VS Premultiplied Alpha"},"content":{"rendered":"

Have you ever tried figuring out the difference between Straight Alpha and Premultiplied alpha and when to use which?<\/strong><\/p>\n

Some people insist premultiplied alpha is the way to go, some say straight alpha.<\/p>\n

To be frank, both are viable depending on the situation as long as the math and compositing software's interpretation of the channels is done correctly. But there are cases only one of the two should be used for best results.<\/p>\n

But let's start with an explanation of what premultiplied and straight alpha is:<\/p>\n

Premultiplied Alpha<\/h2>\n

In premultiplied alpha, partly transparent pixels of your image will be premultiplied with a matting color<\/strong>.<\/p>\n

In 9 out of 10 cases, this color will be black, though it is often possible to specify the color yourself.<\/p>\n

If you are 3D rendering an Image with transparent Pixels, say, a glass object, the background color will be whatever is behind this object<\/strong>.<\/p>\n

This means, although you have an alpha channel (RGB[A<\/strong>]) for your image, the RGB channels will be matted (premultiplied) with the (specified) background color.<\/p>\n

If the alpha interpretation settings in your software (eg. After Effects, Photoshop) are correct, the amount of matted color will be subtracted from your RGB Pixels by using the value in the alpha channel.<\/p>\n

Images with premultiplied alpha will look correct, even when the alpha-channel is ignored (or not supported by early-day applications).<\/p>\n

Pixel-explanation:<\/strong><\/p>\n