Understanding Alpha Channels | Heaton Research

Understanding Alpha Channels

    Alpha channels allow portions of an image to appear transparent. Consider a window. A texture could be used to create a realistic looking window. However, it may be desirable to be able to see through the window. To do this, a window can be created using alpha channels to specify which parts of the window should be transparent. First a window is loaded into Photoshop, as shown in Figure 2.13.

Figure 2.13: A Window

A Window

    This image was taken with a digital camera. It provides a good starting point for a window texture. This window has a total of 12 panes. Six of the panes are on the top and six are on the bottom. To make it easier to select the windowpanes, you should use the zoom function to focus directly on the panes. This does not alter the image, it simply provides you with a better view of the area being worked on. To zoom in, select the magnifying glass on the tool bar and click where the magnification should occur. To zoom back out, hold down the alt key and click while using the magnifying tool.

    To create a transparent region, the first windowpane should be selected using the rectangular marquee tool, as discussed earlier in this chapter. Figure 2.14 shows the first pane selected.

Figure 2.14: The First Window Pane

The First Window Pane

    Alpha channels can be created by selecting regions of an image and then saving the selection. The region that is select will be opaque, and the region not selected will be transparent. The easiest way to accomplish this in the windowpanes example is to select each of the panes, one-by-one. Once all of the panes have been selected, the selected regions can then be inverted, so the opaque regions are selected. To invert, choose “Inverse” from the “Select” menu.

Figure 2.15: All Window Panes

All Window Panes

    Once the correct region of the image has been selected, the alpha channel must be created. To create an alpha channel, choose “Save Selection...” from the “Select” menu. The defaults for the “Save Selection” dialog box can be accepted, as shown in Figure 2.16.

Figure 2.16: Creating the Alpha Channel

Creating the Alpha Channel

    To see the alpha channels, select the “Channels” palette. If the “Channels” palette is not visible, select it from the “Window” menu. Click the “Eye” next to the “Alpha 1” channel. This will put red in front of every area covered by the alpha channel, as shown in Figure 2.17.

Figure 2.17: Viewing the Alpha Channel

Viewing the Alpha Channel

    The image should now be saved as a Targa file. Targa is a graphics file format. Targa supports transparency. Select “Save As...” from the “File” menu. Select the Targa file format, as shown in Figure 2.18.

Figure 2.18: Saving the Targa File

Saving the Targa File

    Make sure the Targa file is saved as “32 bits/pixel.” Once the Targa file has been saved, it can be uploaded to Second Life. To upload an image into Second Life, select “Upload Image” from the “File” menu. Second Life will display a preview of the transparency, as shown in Figure 2.19.

Figure 2.19: Uploading a Transparent Image

Uploading a Transparent Image

    If the transparency looks correct, then choose to upload.

    The texture can now be applied to a prim in Second Life. Figure 2.20 shows the texture being used in Second Life.

Figure 2.20: Using a Transparent Texture

Using a Transparent Texture

    The transparent texture allows the user to see through the window.

Copyright 2005-2009 by Heaton Research, Inc.