TGA, also known as Targa, is a simple raster format that survives in computer graphics and games. Game engines and modding tools use it for textures with an alpha channel, 3D programs such as Blender or 3ds Max render image sequences into it, and video compositing software exchanges frames in it. Older games, Quake III Arena for example, saved their screenshots as TGA. Outside this world the format is rare, so a TGA file usually comes from a texture pack, a game mod or a render.
History
The format was defined in 1984 at AT&T's EPICenter for its TARGA graphics boards; the name stands for Truevision Advanced Raster Graphics Adapter. In 1987 the team left AT&T as an independent company, Truevision, whose Targa cards pioneered video editing on the PC. Version 2.0 of the file format followed in 1989. Truevision was later acquired by RasterOps (1992) and Pinnacle Systems (1999), which in turn became part of Avid. Nobody has developed the format since; the specification was never an official standard and today circulates as a PDF copy of the original Truevision document.
How TGA works
- Header of 18 bytes with image type, dimensions (up to 65,535 pixels per side), bit depth and an image descriptor byte, then an optional ID text up to 255 characters, optional palette and the pixels.
- Image types: palette, true colour and greyscale, each uncompressed or compressed with lossless RLE (run-length encoding). RLE helps with flat areas, for photos or noisy textures it saves little.
- Bit depth 8, 15/16, 24 or 32 bits per pixel. 32 bits means 24-bit colour plus an 8-bit alpha channel, which is why TGA was popular for textures and video keying long before PNG.
- Origin corner. Pixels are stored from the bottom-left corner by default; a flag in the descriptor switches to top-left. Readers that ignore the flag show the image upside down.
- Version 2.0 adds an extension area (author, comments, date, software, gamma, the alpha type), a small thumbnail called a “postage stamp” and a 26-byte footer ending with the signature
TRUEVISION-XFILE. Version 1.0 files have no signature, so programs recognise TGA only by the extension. - No ICC profile, no layers, one image per file.
Opening and editing TGA
On Windows the built-in apps usually do not open TGA; free viewers such as IrfanView or XnView MP do, and Paint.NET and GIMP can edit it. macOS Preview displays TGA. On Linux, GIMP, Krita and most image viewers read it. Phones generally do not, so convert to PNG first. Photoshop and all common 3D and game tools read and write TGA.
Common TGA problems
TGA is upside down
The writing program stored the image bottom-up but the reader expects top-down, or the origin flag was set incorrectly. Flip the image vertically in an editor, or convert it to PNG; our converter honours the flag.
TGA has no transparency or a black background
The file contains a fourth channel, but the header says “0 alpha bits” or the extension area marks the channel as unused, so programs ignore it. Some writers also store premultiplied alpha, which produces dark fringes. In GIMP or Photoshop you can check whether an alpha channel is present and export again correctly.
TGA won't open in Windows or on the phone
That is a missing codec, not a damaged file. Convert TGA to PNG: it is also lossless, keeps alpha and opens everywhere.
Textures take too much space
Uncompressed 32-bit TGA at 4096 × 4096 pixels takes 64 MB. PNG stores the same pixels much smaller; game engines often prefer DDS, which the graphics card reads directly.
Converting TGA
The most common conversion is TGA to PNG, lossless and with transparency, for sharing, the web or engines that prefer PNG. TGA to JPG suits previews of renders; transparent areas become white. In the other direction, PNG or TIFF to TGA is needed for older game engines and mods. In our converter, the alpha channel is kept when writing TGA, PNG or TIFF and replaced by white in JPG and BMP. Among the targets is also DDS, the DirectX texture format.
TGA at a glance
| Developed by | AT&T EPICenter, later Truevision |
|---|---|
| First release | 1984 (version 1.0) |
| Current version | TGA 2.0 (1989), no further development |
| Type | raster image |
| Compression | none or lossless RLE |
| Colour depth | 8, 15/16, 24, 32 bits (8-bit alpha) |
| Typical use | game textures, render output, video frames |
Descriptions by the Library of Congress: TGA 2.0 and TGA 1.0.