That damned channel
If you’re reading this I hope that you have some technical interest in the digital content creation (DCC) thingamajigga - if you don’t, then save wasting a few precious minutes of your short and tragic life and leave now!
Alternatively, if you’re reading this because someone in the studio has sent you a link to this blog post, then you’ve probably been a very naughty client and almost definitely deserve a slap - so you better be paying attention!

The troublesome channel - The alpha channel (represented in greyscale)
So this is a post about the usage of alpha channels to create image transparency - putting one image over the top of another image and the bottom image showing through the “holes” in the top image. Simple enough concept, but it has led to many funky end results.
The most common technique for transparency is to save an image with an additional channel called an alpha channel. A typical image has three channels (red, green and blue) - these are combined to make the visual “colour” of a pixel (i.e. 25% red and 0% green and 50% blue make a deep violet). Basically the additional channel (the alpha channel) is then used to determine how transparent that pixel will be (i.e. 50% alpha makes the pixel partially see-through). Still pretty simple… what comes next is the thing that generates the confusing problem that many have run into.

An image with transparency (displayed on a checkerboard)

The RGB values only (ignoring the alpha values)
So if an image is transparent, what is displayed in the transparent parts when there is not another image behind the image with the alpha channel? A lot of digital content creation (DCC) tools use a grey/white checker board as a visual motif to indicate transparent portions of an image. But what if the viewing environment doesn’t support this display style or you simply want to ignore the transparency? Most people would say a black background - which is logical, black = void = empty = see-through. People from a print background would probably say white - which is once again logical, white = blank paper = empty = see-through. Okay fine, each to their own … but what is the colour of a pixel that is partially transparent?
If a pixel “A” is white (100% Red, 100% Green, 100% Blue) but is 50% transparent, on a black background we would see a grey pixel, as opposed to on a white background the pixel would still be white - and just to make it a bit more complicated, if on a blue background pixel “A” would be displayed as a light blue pixel. This may seem fine, but what if we don’t know the colour of the background that was assumed in the transparent image and how do we remove the “bleed” of the assumed background colour from the pixel to get the correct colour for the transparent pixel.
To solve this problem there are two standard approaches for storing an image with an alpha channel - both quite different, and NOT interchangeable.
The first is “straight”. A straight image doesn’t blend the transparent image with the background colour in anyway - assuming the final colour of the pixel is only the transparent colour and ignoring the background colour. The issue with this approach is that if viewed without transparency you will get strange colour artefacts around the very transparent parts of the image (see the image of RGB value only above). It is particularly noticeable if the transparency falloff is feathered.

The image on black (as it would be seen as RGB values using premultiplied on black)
The second approach is “pre-mulitplied”. With this approach we get the expected blending between the transparent image and the assumed background. The special consideration is when the image is displayed with transparency, the transparent pixel colour is recreated correctly by assuming the pixel colour was pre-multipled (with regard to the colour values) with a specified background colour. This requires the specification of a background colour (typically assumed to be black). If an incorrect background colour is used, then you will get strange haloing artefacts in the transparent feathered edges.

Correct alpha interpolation - Image composited on blue using the right matting colour
If the wrong method is used to interpolate the treatment you can get some very ugly image artefacts. The most common is not removing a pre-multiplication, this creates a black halo (if using a black background) or a white halo (if using a white background). If a straight image is assumed to be pre-multiplied then you will get “sparkling” pixels around the transparent parts of the image.

Incorrect alpha interpolation - Image composited on blue using the wrong matting colour
Hope this help those struggling with that damned channel. Go have a beer, you deserve it ![]()
0 comments
Kick things off by filling out the form below.
You must log in to post a comment.