Help Support the Baja Engine! Donate to Breezeway Studios!
Creating TGAs with Alpha Channels



TGA image files with alpha channels are used when you want to make buttons with transparent areas or textures with transparent areas.

In Photoshop Versions other than Elements

In Photoshop, you need to have a flattened color image and a grayscale mask. Take your flattened color image and open up its channel's palette (usually grouped with the layers palette). On the channels palette, add an additional 4th channel and paste your grayscale mask in it. Then save this as a TGA! That's it. Note: On the grayscale mask, white is visible and black is invisible.

In Photoshop Elements

Elements can't make TGAs with alpha channels. So, save it as a BMP or PSD and use the Gimp method below. If you don't have the Gimp, it is a free program; more info can be found on the Recommended Tools page.

In the Gimp

If your image has one layer, and that layer is transparent (erased) where you want the TGA to be transparent, then all you need to do is save the file as a TGA! You should be able to see a checkerboard pattern showing through the transparent areas of your image. Go to file>Save As and type in a filename with .tga at the end. Be sure to choose RLE compression, because this will make your files smaller.

If you have your color image, and a separate grayscale mask, you need to turn it into a single layer with transparency. You can do this by copying your mask (and then closing its file or deleting its layer). Then, select the layer of your color image. Go Select>Toggle QuickMask (shift-q) and then paste in your mask. Then, switch out of quickmask mode (shift-q again). Then go Edit>cut (ctrl-x). Then you should be able to save it as a TGA! If, when you cut, it took away the wrong part of the image, you probably need to invert your selection (ctrl-i). Also, note that the layer with the color information can't be a background layer because these can't have transparency. Go to file>Save As and type in a filename with .tga at the end. Be sure to choose RLE compression, because this will make your files smaller.

1. highlight the mask layer in the layer panel
2. select all (ctrl a)
3. copy (ctrl c)
4. delete the mask layer in the layer panel - trash can
5. select the color image layer
6. toggle QuickMask (shift q)
7. paste (should now have a pink semi-transparent color over the part that will be transparent)
8. toggle QuickMask (shift q) - the pink part is still there, but not visible
9. save as a tga, use defaults (RLE and origin at bottom left)

Notes About Edges: Halos

Lets say that you wanted to make a green circle sprite. If you made your color channel be a green circle on a white background, and then made your mask be a white circle on a black background, you would find out that the TGA circle had an annoying white circle halo around it! This is because some of the white background wasn't getting completely masked, probably due to anti-aliasing in the mask. To fix this problem, make sure your color in your color channel completely extends to the edge of the mask! The easiest way to fix the circle problem would be to fill your color channel completely green, and draw the circle only in the mask.