TGA Files: The Truevision TARGA Format for Games and Visual Effects
TGA (Truevision Advanced Raster Graphics Adapter), also known as TARGA, is one of the oldest raster image formats still in active use. Created by Truevision (AT&T) in 1984 for its framegrabber cards, TGA was one of the first formats to support full 24-bit color (true color) and alpha channel transparency. While PNG and EXR have displaced it in many workflows, TGA remains embedded in the pipelines of game engines, 3D animation software, and broadcast graphics tools — valued for its simplicity, zero compression overhead, and reliable alpha channel support.
TGA File Structure
TGA is a straightforward binary format with minimal overhead. The file consists of:
18-byte header:
- Image ID length (1 byte)
- Color map type (1 byte) — 0 for no color map (true color), 1 for color-mapped (indexed)
- Image type (1 byte) — 0 (no data), 1 (color-mapped), 2 (true color), 3 (grayscale), 10 (RLE true color), 11 (RLE grayscale)
- Color map specification (5 bytes)
- Image specification (10 bytes): x/y origin, width, height, bits per pixel, image descriptor
Image data: Raw pixel data, optionally compressed with RLE (Run-Length Encoding)
Footer (TGA 2.0 only, 26 bytes): Extension area offset, developer area offset, signature (TRUEVISION-XFILE)
The TGA 2.0 spec (1989) added the footer, extension area (containing author name, creation date, gamma correction, color profile fields), and developer area. Many tools produce TGA 2.0 format by default.
Color Depth Options
TGA supports multiple color depths:
- 8-bit grayscale: Single channel, 256 shades of gray
- 8-bit indexed: 256-color palette (color map), common in older game textures
- 16-bit: 5-5-5 RGB (32,768 colors) or 5-5-5-1 RGBA (with 1-bit alpha)
- 24-bit: 8 bits per channel (RGB), 16.7 million colors — the most common TGA variant
- 32-bit: 8 bits per channel (RGBA), full alpha channel — the most common variant in game and VFX pipelines
Note: TGA stores channels in BGR order (blue-green-red), not the standard RGB order. Software must account for this byte order when reading raw TGA data.
Why TGA Is Still Used in Game Development
Zero compression overhead: Uncompressed 32-bit TGA reads linearly from disk with no decompression step. For texture loading at runtime, this can be faster than PNG (which requires zlib decompression) on hardware where I/O is fast but CPU time is precious.
Reliable alpha channel: TGA's 32-bit mode has been supporting alpha channels since the 1980s. In the early days of game development, TGA was the only widely-supported format with a straightforward alpha channel. Game engines like the Quake engine, early versions of Unreal, and Valve's GoldSrc engine all used TGA for textures.
Simple parser: The TGA format is simple enough to implement in about 200 lines of C code. For embedded systems, custom game engines, or tools with minimal dependencies, TGA's simplicity is an advantage.
VFX industry inertia: Autodesk Flame, Shake, and early versions of Nuke used TGA extensively for frame sequences. Even though modern pipelines prefer EXR, TGA files from the 1990s–2000s remain in archives that tools must still read.
UV maps and normal maps: Many 3D tools export texture maps as TGA by default. Blender, Maya, 3ds Max, and ZBrush all export TGA for UV maps, diffuse maps, and normal maps.
TGA Compression: RLE
TGA supports optional Run-Length Encoding (RLE) compression. RLE compresses regions of identical pixels well — solid color backgrounds and areas with flat colors compress significantly. However, it performs poorly on photographs or textures with complex detail, often expanding the file slightly.
For game textures with large flat areas (like UI elements), RLE TGA can save meaningful space. For photographic content, uncompressed TGA or PNG (which uses LZ77) is preferable.
Converting TGA Files
TGA to PNG (recommended — PNG supports alpha, lossless, widely supported):
# Single file
ffmpeg -i input.tga output.png
# Or using ImageMagick
convert input.tga output.png
# Batch conversion
for f in *.tga; do convert "$f" "${f%.tga}.png"; done
TGA to JPEG (no alpha channel — loses transparency):
convert input.tga -background white -flatten output.jpg
TGA to OpenEXR (for VFX pipelines requiring high dynamic range):
# OpenImageIO's oiiotool
oiiotool input.tga -o output.exr
TGA sequence to video (rendering image sequences):
# TGA frame sequence (0001.tga, 0002.tga...) to MP4
ffmpeg -framerate 24 -i %04d.tga -c:v libx264 -pix_fmt yuv420p output.mp4
TGA vs. PNG for Textures
| Feature | TGA (uncompressed) | PNG |
|---|---|---|
| Alpha channel | ✅ 8-bit | ✅ 8-bit |
| Lossless | ✅ | ✅ |
| Compression | Optional RLE | LZ77 always |
| File size (photo) | Larger | Smaller |
| Decode speed | Fastest (no decompression) | Slightly slower |
| Browser support | ❌ | ✅ |
| HDR support | ❌ | Limited (16-bit) |
| Color precision | 8-bit per channel | Up to 16-bit per channel |
For web use, PNG is always better — browsers cannot display TGA. For real-time game textures where decoding speed matters, uncompressed TGA still has a use case. For modern game pipelines, DDS (DirectDraw Surface) with GPU-compressed formats (DXT1/5, BC7) has largely replaced both TGA and PNG for runtime textures.
Software Support
Reading TGA: Virtually every image editing application supports TGA. Adobe Photoshop, GIMP, Krita, Affinity Photo, Paint.NET all open TGA natively.
Writing TGA: Same broad support. Photoshop's TGA export dialog offers 16-bit and 32-bit options with alpha channel control.
Game engines: Unity, Unreal Engine, Godot all import TGA as textures and convert them to internal compressed formats (BC7, DXT5, ASTC) during build.
3D software: Blender, Maya, 3ds Max, Cinema 4D, ZBrush all read and write TGA. Many default to TGA for UV map exports.
TGA File Size
An uncompressed 32-bit RGBA TGA at 4096×4096 (a standard high-resolution game texture) = 4096 × 4096 × 4 bytes = 64 MB. This makes TGA impractical for web delivery but acceptable for local asset pipelines where disk I/O handles large files quickly.
By comparison, the same image as PNG compresses to 5–20 MB depending on content complexity. DDS with BC7 compression (GPU-native) achieves 16 MB with minimal quality loss.