Truevision TGA (Legacy MIME Alias)
image/x-tga
Released 1984
· by Truevision Inc.
The image/x-tga MIME type is a common unofficial alias for the Truevision TGA (TARGA) image format. Created in 1984 by Truevision Inc. for their early video capture boards, TGA was a pioneering raster format supporting 24-bit true color and a 32-bit alpha channel on PCs. Its straightforward byte structure, native transparency, and fast, lossless Run-Length Encoding (RLE) compression made it an industry standard for 3D animation, video editing, and video game textures throughout the 1990s and 2000s. Although standard MIME validators typically prefer 'image/tga' or 'image/x-targa', 'image/x-tga' is frequently encountered in legacy systems, game engine asset pipelines, and older web servers.
Technical Specifications
.tga.icb.vda.vst
NoneRLE
image/tgaimage/x-targaapplication/tga
Magic Bytes & HTTP Headers
TRUEVISION-XFILE.\x00
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | Legacy |
Advantages & Limitations
- Incredibly simple byte layout allows developers to write custom loaders and exporters in a few dozen lines of code, bypassing the need for heavy external libraries
- Native support for 8-bit alpha channels ensures flawless transparency masking for real-time 3D rendering
- Fast, predictable RLE decoding requires almost no CPU overhead compared to DEFLATE (PNG) or DCT (JPEG)
- RLE compression is relatively weak by modern standards, resulting in large file sizes
- Lacks a standard magic byte header at the beginning of the file, making file-sniffing unreliable for older v1.0 files
- Zero support in web browsers; must be converted to PNG or WebP for web delivery
Developer Code Snippets
File Detection Steps
How to programmatically detect a image/x-tga
file by reading its raw bytes:
- 1 Because TGA 1.0 files do not have a magic number at the beginning of the file, MIME detection strictly by reading offset 0 is impossible.
- 2 The TGA 2.0 specification introduced a file footer. To detect a TGA 2.0 file, seek to the end of the file. The last 26 bytes make up the footer. Bytes 8 through 23 of this footer (18 bytes from EOF) contain the ASCII signature 'TRUEVISION-XFILE.' followed by a null terminator.
- 3 When encountering 'image/x-tga' in file uploads, it is recommended to normalize the MIME type string in your database to 'image/tga' or 'image/x-targa' to align with broader conventions.
Software Support
ImageMagick
Conversion Tools
Share & Embed
[](https://freewebptojpg.com/mime/image/tga)
<iframe src="https://freewebptojpg.com/mime/image/tga/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="TGA Specs"></iframe>
JSON API
All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.
GET https://freewebptojpg.com/mime/image/tga.json
Open JSON
Frequently Asked Questions
What is the difference between image/x-tga and image/x-targa?
There is no difference in the underlying file. Both MIME types refer to the Truevision TGA (TARGA) image format. 'image/x-targa' and 'image/tga' are more commonly recognized by modern systems, while 'image/x-tga' is an older alias often generated by legacy software.
Why do video games still use TGA files?
TGA files are structurally very simple, making them incredibly fast for a game engine to decode and load into memory (VRAM). Their native support for an 8-bit alpha channel also ensures perfect transparency masking for 3D textures, decals, and foliage.
How do I detect a TGA file programmatically?
Original TGA 1.0 files lacked a header signature. However, the TGA 2.0 specification introduced a file footer. You can reliably detect a TGA 2.0 file by reading the last 18 bytes of the file, which will contain the ASCII string 'TRUEVISION-XFILE.'.