Last month, I explored the pixel-based grid that underlies all bitmapped images and talked about the stacked layers of data, or ‘channels’, via which colour is handled. In the ubiquitous RGB format, for example, separate red, green and blue channels – each specifying up to 256 brightness levels – combine to depict over 16 million possible colours (256 x 256 x 256), which is more than enough for continuous-tone, full-colour photography. However, the bitmap’s channel-based architecture has uses beyond representing colours, and additional channels can play a crucial role in intensive bitmap editing.
To the computer, a bitmap is simply an array of numbers with no intrinsic meaning or content, but to us the reverse is true – we have no interest in pixel data per se but only in image content, the meaningful elements of a picture. Whenever we work on an image, we bridge these two very different worlds to change the blue of the sky, to sharpen an eye, to blur distracting background objects and so on. We need to accentuate meaning and control in the bitmap-editing process, but since image content is not visible to the computer we have to manually isolate meaningful elements using the various selection tools: the Marquee, Lasso and Magic wand. Once we have isolated such an element, all the tools, adjustments and filters confine their action to this current selection, as indicated by Photoshop’s famous marching ants outline. This is a laborious process at best and soul-destroying if every time we want to go back and tweak a picture element we first have to manually re-isolate it.
The solution is to save the selections we have made in the bitmap itself, and the natural way to do this is as an additional bitmap channel. Storing every pixel in the selection as white and every pixel outside it as black creates a mask or alpha channel, which can be reloaded to recreate that selection. Within Photoshop, this process is handled via the Channels palette, which is primarily used for viewing and working with the separate colour channels. The Save Selection command automatically adds the current selection as a new alpha channel to the bottom of the palette list, which can be viewed and edited, or by Ctrl-clicking instantly reloaded as a selection/mask. To save such added intelligence for future sessions, you will need to save the image in a format that supports alpha channels; for example, Photoshop PSD/PDF or the ever-adaptable TIFF.
At first sight, an alpha channel looks like a simple 1-bit black-and-white overlay, but if you zoom in on its edge you will see that the pixels there aren’t solid black or white but various levels of grey. This is because, by default, all Photoshop’s selection tools anti-alias the edges, meaning that the alpha channel is actually 8-bit. Such anti-aliasing is crucial when creating photo montages, as it avoids jaggies and makes pasted-in elements merge more naturally with the new background. Also, when using selections as masks to apply adjustments or filters, it avoids undesirably abrupt changes.
So what exactly is going on here? Variations in the brightness of pixels in the alpha channel alter the values of the corresponding pixels in the colour channels – whether greyscale, RGB, CMYK or multichannel – so that the alpha channel controls the opacity/transparency of the colour channels. And there is no reason such control over transparency need be limited to anti-aliased edges. Using the Marquee and Lasso selection tools’ Feather setting, for example, you can cut and paste a feathered selection into a new file to produce vignette-style effects. Alternatively, by directly painting onto an alpha channel, it is possible to set up a variable transparency mask to control precisely how a tool, adjustment or filter is applied. For instance, by applying a black-to-white gradient to the alpha channel and then selecting it with an artistic filter, you can create the effect of a photo that seamlessly blends into some artistic interpretation.