TGA and the alpha channel

I need some help. I’m confused about targa files and the alpha channel. I know you can do some effects with them because of the transparency, but if somebody could please explain how these files are used. And if anybody knows any good sites that explain how to make a targa. Thanks.

You can check http://www.wotsit.org to find a good document on the tga image format. Basically an alpha component can be used for things like transparency, as you said. You have to enable blending and use the right blend function (usually glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) works pretty well.) If you are using unsigned bytes for the colors (i.e. 0-255) then 255 means fully opaque, 0 means fully transparent, and anything in between will cause blending to make it look semi-transparent. I know people have posted routines for loading TGA files here in the past so you can do a search for code.

So far as programs that can save TGA files, there are a few. I use the Gimp, which is a Linux program that has a Windows port. You can grab the Windows version here. There are other programs I’ve heard that can export TGA such as Paint Shop Pro. Photoshop doesn’t export TGA files, though.

The official Targa file format is here
ftp://ftp.truevision.com/pub/TGA.File.Format.Spec

Photoshop v5.x can save Targa files in 24 and 32bpp format. Choose File|SaveACopy… and select Targa.

[This message has been edited by Frumpy (edited 06-27-2001).]

I don’t think Paint Shop Pro can export 32 bpp tga files, only 24… sorry.

TheDD

Oops… that’s right. Photoshop can export TGA. I was thinking of the PPM and PGM files that I had to use for a graphics class. Photoshop wasn’t able to export to those formats, and THAT is what I had gotten the Gimp for.

BTW, the Gimp isn’t a bad little app for graphics. It’s got some interesting things for creating images.

Paint Shop Pro most definately can save 32 bit TGA files. That’s all I use. It’s just a little confusing how it deals with alpha. (You make a mask image for the alpha channel and then save it to the alpha channel of the texture image and then save the file as tga. Why it doesn’t use layers for alpha I’ll never understand.)

[This message has been edited by DFrey (edited 06-28-2001).]

Photoshop supports 8,16,24,&32bit tga’s
Gimp is NOT a good image package. Having had to use it for three years now on unix, it has some interesting ‘features’, but I’d call them bugs…

PhotoShop anyday…

Hi,

On my site, I’ve a little example who use the alpha chanel with TGA file.
http://ibelgique.ifrance.com/Slug-Production

“Download” section.

Heheh. One of the things I like about the gimp is some of the scripting stuff. I used some of the “terrain” scripts for making a quick and dirty planet texture once. I prefer Photoshop for most things, though.