Origin and purpose
TGA (Truevision Graphics Adapter, also called Targa) was introduced in 1984 by Truevision for the company's TARGA and VISTA series of graphics adapters — high-end (for the time) video capture and display boards used in early computer graphics and video production. The format was designed as the native file format for the hardware's framebuffer captures.
For its era, TGA had several technical advantages over the alternatives: it supported 24-bit and 32-bit colour depth at a time when most formats topped out at 8-bit indexed colour, it supported a full alpha channel, and it had a straightforward file structure that was easy to parse.
These properties — 24/32-bit colour, alpha channel, simple structure — turned out to be exactly what the game development and 3D rendering industries needed for texture assets. TGA quietly became the de facto standard texture format for PC game development through the 1990s and persists in some game engine pipelines today even as more capable alternatives exist.
File structure
A TGA file consists of:
- Header (18 bytes) — image type, dimensions, bit depth, alpha bits, image descriptor.
- Optional Image ID (variable) — a brief identifier or comment.
- Optional Colour Map — for palette-mode images.
- Pixel data — the actual image content.
- Optional Footer (26 bytes, added in TGA 2.0) — extension areas, developer area, and a signature.
The header's image type field selects the storage mode:
- Type 0 — no image data.
- Type 1 — uncompressed indexed-colour (palette).
- Type 2 — uncompressed RGB (8-bit per channel) or RGBA.
- Type 3 — uncompressed greyscale.
- Type 9 — run-length-encoded indexed-colour.
- Type 10 — run-length-encoded RGB or RGBA.
- Type 11 — run-length-encoded greyscale.
Most TGA files in modern use are type 2 (uncompressed 24/32-bit) or type 10 (RLE-compressed 24/32-bit). The RLE compression is simple but effective on images with flat colour regions; it provides little benefit on photographic content.
Why TGA persists in game development
TGA achieved its game-industry niche through a combination of properties that mattered when modern formats didn't exist or weren't viable:
- 24-bit and 32-bit colour with alpha — when GIF was the only widely-known alternative, TGA's full colour depth was a step up.
- Lossless storage — game textures need to be edited and re-saved without quality degradation. JPEG's lossy compression made it unsuitable.
- Simple decoder — the format is trivial to parse, important for early game engines with limited CPU budget for asset loading.
- Alpha channel support — essential for game textures (sprites, UI, terrain blending masks, particle textures).
- Wide tool support — every art tool from Photoshop to GIMP to Pixelmator handles TGA.
By the time PNG arrived in 1996 and offered most of the same benefits with better compression, TGA had already become embedded in game pipelines. Switching texture formats is expensive (asset tooling, conversion scripts, validation), and PNG's advantages weren't dramatic enough to force the migration in many studios.
The result: TGA is still the default texture format in some commercial game engines and many indie game projects, despite PNG, WebP, and game-specific formats like DDS being technically superior for most use cases.
TGA's compression
The RLE compression option (image types 9, 10, 11) is a simple run-length encoding:
- Sequences of identical pixels are stored as a count plus the pixel value.
- Sequences of distinct pixels are stored verbatim with a flag byte.
This compresses well on:
- Game UI textures with large transparent or single-colour regions.
- Sprite sheets with consistent backgrounds.
- Heightmaps and masks with flat regions.
It compresses poorly on:
- Photographic content.
- Hand-painted textures with subtle gradients.
- Any image with high entropy.
For most game textures, the savings from RLE are modest. PNG's DEFLATE compression typically produces files 30–60% smaller than RLE TGA.
TGA vs PNG vs other texture formats
| Aspect | TGA | PNG | DDS | WebP |
|---|---|---|---|---|
| Compression | Optional RLE | DEFLATE (lossless) | Block compression (lossy) | Lossy or lossless |
| File size | Largest | Medium | Smallest at runtime | Smallest at rest |
| Alpha support | Yes (8-bit) | Yes (8-bit) | Yes | Yes |
| Lossless | Yes | Yes | No (BC formats lossy) | Optional |
| GPU upload speed | Decode required | Decode required | Direct | Decode required |
| Encoder complexity | Trivial | Modest | Significant | Modest |
| Tool support | Universal in game tools | Universal | Game-specific | Modern formats only |
For modern game development, the typical asset pipeline:
- Artists work in PSD or PNG for editable source files.
- Build pipeline converts to DDS or KTX2 for runtime GPU loading.
- TGA exists as an intermediate or legacy format in some workflows.
Browser support
Most modern browsers do not render TGA. The format never gained adoption in the browser ecosystem (PNG covered the same use cases with better compression), and there has been no demand to add it.
For web use, TGA must be converted to a web-compatible format. The conversion is straightforward since TGA is uncompressed (or simply RLE-compressed) and easy to decode.
Conversion guidance
TGA-to-web conversion:
- ImageMagick — supports TGA reading and writing:
convert input.tga -quality 80 output.webp convert input.tga output.png - Sharp (Node.js) — handles TGA input via libvips:
await sharp("input.tga") .webp({ quality: 80, effort: 6 }) .toFile("output.webp"); - GIMP, Photoshop, Affinity Photo — all handle TGA natively.
For game asset pipelines that consume TGA, the typical processing:
- Load the TGA from disk.
- Apply texture compression (BC1/BC3/BC7) for GPU use.
- Save as DDS or KTX2 for runtime loading.
TGA itself is rarely the runtime format; it's an intermediate between artist tooling and compressed delivery format.
Modern relevance
TGA matters for:
- Game asset pipelines — many studios and indie projects still use TGA as the source texture format.
- 3D rendering — older renderers and some modern ones still accept TGA for texture inputs.
- Game modding — many popular games' modding communities work with TGA texture files.
- Game engine compatibility — Unity, Unreal Engine, Godot, Cocos2d, and others all import TGA natively.
- Legacy graphics tools — some older 3D and animation tools still default to TGA output.
TGA does not matter for:
- Web image display — browsers don't render it.
- General photography or graphics — use PNG, WebP, or JPEG.
- Storage efficiency — PNG is smaller for the same content.
- Cross-platform image sharing — limited tool support outside game and 3D contexts.
When to use TGA today
Choose TGA when:
- The pipeline explicitly requires TGA (some game engines, some 3D tools).
- The convention is established in your team's workflow.
- A downstream tool only accepts TGA input.
- You're maintaining backwards compatibility with legacy game projects.
Choose other formats when:
- You're starting a new project (use PNG for source textures, then compress to DDS/KTX2 for runtime).
- The image is for web delivery (use WebP or AVIF).
- File size matters (PNG is smaller than TGA for the same lossless content).
- The tool chain supports modern formats and your team is willing to update conventions.
File size
TGA files are larger than the modern alternatives. Rough sizes for a 1024×1024 32-bit texture:
- TGA uncompressed — 4 MB.
- TGA RLE-compressed — 3–4 MB (depends on content).
- PNG — 1–2 MB (lossless).
- WebP lossless — 800 KB – 1.5 MB.
- DDS BC7 — 1 MB (lossy but GPU-ready).
For source files that get processed into runtime formats, the TGA vs PNG choice is mostly about convention. For runtime use, DDS or KTX2 wins decisively.
Common scenarios
A game project's texture folder is full of .tga files. This is normal in many game pipelines. Convert to whatever runtime format your engine prefers; keep the TGAs as source files.
A 3D modelling tool exports textures as TGA. Modern tools usually offer PNG export too. Switch the export setting if you can; otherwise the TGAs are fine as an intermediate format.
A web platform receives TGA uploads. Convert to WebP or PNG before storage. Don't serve TGA directly.
A render farm produces TGA frames. Many production renderers default to TGA or EXR for frame sequences. For final delivery (web, social, broadcast), convert to MP4, animated WebP, or JPEG sequence as appropriate.
Further reading
- PNG Format — recommended replacement for TGA in most contexts
- DDS Format — GPU-compressed format for runtime texture use
- WebP format overview — modern format for web delivery
- Lossy vs Lossless Compression — broader compression framework