Truevision TGA Image (.tga)
Truevision StandardTruevision TGA (Targa) is a raster format associated with Truevision's TARGA video capture boards and used in some graphics and game asset workflows, particularly in the 1990s and 2000s.
Convert TGA to PNG
Free in-browser TGA to PNG converter. Convert files instantly on your device.
Inspect & Metadata
Operating systems and file analyzers identify TGA files by inspecting the leading binary byte sequence:
Byte-Level Header Signature (Magic Bytes)
Operating systems and file analyzers identify TGA files by inspecting the leading binary byte sequence:
HEX SIGNATURE (OFFSET 0):
No fixed signature (TGA header fields vary)ASCII REPRESENTATION: No fixed ASCII signature
Standardization: Truevision TGA File Format Specification v2.0
Technical Specifications
| Container Architecture | 18-byte fixed header followed by image ID, color map, raster pixel data, and optional v2.0 footer |
| Compression | Uncompressed raw scanlines or lossless packet-based Run-Length Encoding (RLE) |
| Byte Endianness | Little-Endian (Intel x86) |
| Color Spaces | Device RGB |
| Channels & Structure | 8-bit grayscale, 16-bit RGB (5-5-5-1), 24-bit RGB, or 32-bit RGBA with alpha |
| Max Dimensions | 65,535 x 65,535 pixels (16-bit dimension fields) |
| Transparency | Full 8-bit alpha channel transparency (in 32-bit mode) or 1-bit alpha (in 16-bit mode) |
| Streaming & Progressive | Sequential scanline streaming; supports top-to-bottom or bottom-to-top orientation |
Technical Comparison Matrix: TGA vs Competitors
| Technical Attribute | TGA (Current) | PNG | BMP | DDS |
|---|---|---|---|---|
| Video Game Texture Use | Used by some 1990s-2000s game engines | Modern 2D UI & web assets | Windows legacy bitmap | DirectX modern compressed GPU format |
| Alpha Channel Support | Clean 8-bit alpha (32-bit mode) | Clean 8-bit alpha | Limited 32-bit alpha | DXT/BC compressed alpha |
| Compression Algorithm | Uncompressed or Packet RLE | Lossless Deflate compression; savings vary with image content | Uncompressed / RLE | Direct GPU block compression (BC1-BC7) |
| Signature Location | 26-byte footer ('TRUEVISION-XFILE.') | Byte 0 header ('‰PNG....') | Byte 0 header ('BM') | Byte 0 header ('DDS ') |
Common Corruption Modes & Hex Recovery Guide
Image renders upside down or mirrored horizontally.
Root Cause: Image descriptor bits (bits 4 and 5 in byte 17) misread or inverted by decoder.
Recovery: Toggle vertical/horizontal flip flags or convert using File2File.app TGA Converter.
Security Analysis & Parser Attack Vectors
TGA decoders process packet-based RLE streams where malformed run-length counts can trigger out-of-bounds heap writes.
Known Attack Vectors
- RLE packet length exceeding destination scanline buffer boundary.
- Buffer overflow when reading color map entries exceeding declared color map depth.
- Integer overflow during width * height * (bpp / 8) memory buffer allocation.
Defensive Best Practices: Enforce strict per-scanline boundary checking during RLE packet unpacking.
Historical Origins & Milestones
Key Advantages & Pros
- Extremely simple decoding architecture allows direct GPU texture memory loading with minimal CPU overhead.
- TGA can store 24-bit RGB or 32-bit RGBA data, including alpha, which made it useful in some game texture, sprite, and decal workflows.
- Supports both uncompressed and lightweight lossless RLE compression.
Technical Limitations & Cons
- Larger file footprints than modern compressed texture formats like DDS, KTX2, or PNG.
- Lacks native color profile management (no embedded ICC profiles).
- Original v1.0 TGA files lack a standardized magic byte at byte 0 (identified by header fields and footer).
Interesting Technical Trivia
- TGA was created to capture broadcast video frames on the IBM PC before standard PC monitors could even display 24-bit color.
- TGA 2.0 files are unique because their magic signature ('TRUEVISION-XFILE.') is stored at the very end of the file instead of the beginning.
- TGA was used for textures by some 1990s game engines, including titles from id Software and Valve.
Frequently Asked Technical Questions
Why did game developers love TGA format?
Because TGA files were uncompressed or simple RLE, allowing game engines to load 32-bit textures and alpha transparency directly into video memory without slow decompression.
How do I identify a TGA file without magic bytes at byte 0?
Modern TGA 2.0 files end with the ASCII string 'TRUEVISION-XFILE.' in the last 26 bytes of the file.
How can I convert TGA to PNG?
TGA files can contain an alpha channel used by game textures. Convert to PNG to keep transparency, or to JPEG for a smaller opaque image; this converter runs in your browser.