View Full Version : Purpose of .tga
What is the purpose of a .tga file? I had always thought it was an opengl format but...
I have this code that reads them from file to create a texture, but I don't see an advantage over .bmp, because both store the pixels BGR instead of RGB.
04-11-2006, 08:09 AM
tga supports Alpha channel.
Thanks. I don't think I'll use it to store my images. I'll make my own format.
04-11-2006, 02:41 PM
Having an alpha channel in the image enables you to do more cooler and advanced blending effects. You can have objects parts semi-translucent, etc.
I recommend you to try it.
Use photoshop to edit them.
Joe the Programmer
04-11-2006, 05:49 PM
Making your own format is cumbersome because you must convert it to something that the image editor supports. I rather doubt you want to do that. Just use tga.
True. However, why not just use .bmp rather than .tga? A 32 bit .bmp has an alpha channel.
I still don't see the advantage of .tga.
Joe the Programmer
04-12-2006, 07:09 PM
A 32 bit .bmp did not have an alpha channel when I last checked.
The fourth channel is used as the alpha channel: BGRA
04-13-2006, 06:14 AM
you are both right : http://en.wikipedia.org/wiki/Windows_bitmap
"A 32-bit version with integrated alpha channel has been introduced with Windows XP"
but " it has yet to gain wide support in image editing software."
btw do whatever you want with your image loader, file formats are not related to OpenGL...
04-13-2006, 01:13 PM
And if I am not mistaken .bmps do not have the option to be compressed like .tga do...
They also have the option of RLE compression.
I didn't know that bitmaps had a time when they didn't support 32 bit. Although I guess that even if Windows 98 does not support 32 bit bmp's it really doesn't matter because any good, modern image editing software should.
04-15-2006, 03:17 AM
Are you sure about RLE compression? I've never heard of it, but on the other hand, I've never heard about the alpha channel either ;)
But RLE compression is a pretty bad compression for 32-bit images, it's only good for low-color images like 8-bit paletted bitmaps.
Btw, why not use PNG? It supports 32-bit alpha channeled images, and has a very good lossless compression.
04-15-2006, 10:20 AM
The OP wanted something easy to load, even RGB vs. BGR was giving him trouble... :)
both tga's + bmps are easy to read
tga's + bmps both have RLE compression (though if u want better lossless compression, png's are better)
while bmp's do support alpha it was only included in a latter version of bmp (thus support mightnt be 100% with apps), tgas have had alpha from the start.
then again, forget both tga's + bmp's use dds's instead.
-easy to read
04-15-2006, 05:25 PM
Originally posted by zed:
tga's + bmps both have RLE compressionIn case of BMP it's only for 4 & 8bpp indexed images, and the kind of RLE it uses is not good...
Png's sound good to me. Know any good loading code for them instead of libpng?
And what is a dd?
04-15-2006, 08:46 PM
Originally posted by AE:
And what is a dd? DDS - DirectDraw Surface, can store compressed and uncompressed pixel formats.
NVIDIA Texture Tools (http://developer.nvidia.com/object/nv_texture_tools.html)
04-16-2006, 05:00 AM
If you're looking for an easy to use PNG library, use DevIL (openil.sf.net). It can read not only PNG but many image formats and it integrates nicely with OpenGL (e.g. directly load into textures).
It just has some problems with thread-safety ;)
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.