TGA is a legacy raster format from 1984 that stores uncompressed or run-length-encoded pixels with an 8-bit alpha channel. Truevision designed it for early PC graphics hardware, and it became a staple of game texturing and video work. No modern browser displays it, so AVIF — the AV1 Image File Format — is its web-era replacement. This page traces TGA's origin, structure, decline, and the conversion path to AVIF or PNG.
Where TGA came from
TGA was created by Truevision in 1984 for its TARGA and VISTA graphics adapter boards. The name expands to Truevision Graphics Adapter, and the format is also called Targa after the hardware line. Those boards captured and displayed full-colour video on the IBM PC, a rarity when most cards managed 16 colours. TGA was the native file format for their framebuffer dumps, so it carried 24-bit and 32-bit colour years before consumer formats did.
Two facts explain its long survival:
- TGA stored true colour plus alpha when GIF's 256-colour palette was the mainstream alternative.
- TGA parsed trivially — an 18-byte header then raw pixels, cheap for 1980s and 1990s decoders.
How a TGA file is built
A TGA file is a small fixed header followed by pixel data, optionally run-length compressed. The structure is deliberately flat:
- Header — 18 bytes carrying image type, width, height, bit depth, and an image descriptor byte.
- Pixel data — uncompressed or RLE-packed samples in little-endian order.
- Footer — 26 bytes added in TGA 2.0 (1989), holding extension and developer area offsets plus the
TRUEVISION-XFILEsignature.
The image descriptor's low 4 bits set the attribute (alpha) bit count, in practice 0, 1, or 8. A 32-bit TGA is 24-bit RGB plus an 8-bit alpha channel; a 16-bit TGA uses 1-bit alpha. AVIF instead carries 8, 10, or 12-bit alpha inside an ISOBMFF container, the same wrapper used by HEIC and MP4.
What RLE compression does and does not buy
TGA's only built-in compression is run-length encoding, and it is lossless but weak. Identical neighbouring pixels collapse into a count-plus-value packet; runs never cross a scan-line boundary, per page 24 of the v2.0 specification.
RLE helps on flat content and barely touches detailed content:
- Helps — UI sprites, masks, and heightmaps with large single-colour regions.
- Helps — logo plates and title cards with broad solid fills.
- Fails — photographs, painted textures, and any high-entropy image.
A 32-bit 1024×1024 texture is 4 MB uncompressed and often still 3–4 MB after RLE. The same image is roughly 1–2 MB as lossless PNG and far smaller as AVIF, because AVIF applies the full AV1 transform set rather than a 1980s byte run. See Lossy vs Lossless Compression for the trade-off framework.
Where TGA was used
TGA's niche was content pipelines, not the web. Its real-colour plus alpha plus trivial decoding suited three industries that pre-dated PNG:
- Game textures — diffuse maps, sprites, particle art, and blend masks through the 1990s and beyond. Unity, Unreal Engine, and Godot still import TGA natively.
- 3D rendering — texture inputs and frame-sequence outputs from render farms, often alongside OpenEXR.
- Video and broadcast — 32-bit alpha key signals in character generators such as Avid Deko, which is why TGA persists in animation and video work.
By the time PNG shipped in 1996 with the same lossless alpha and better compression, TGA was already embedded in art tooling. Switching texture formats is costly, so studios kept it out of inertia rather than merit.
Why TGA is obsolete for the web
TGA fails three modern web requirements at once:
- No browser renders it. Chrome, Firefox, and Safari never added TGA decoding because PNG covered the same ground better.
- Files are large. Uncompressed or RLE storage produces files 2–4× the size of PNG and far larger than AVIF for identical pixels.
- No delivery features. TGA has no progressive loading, no responsive variants, and no HDR or wide-gamut signalling.
AVIF answers all three: ~94% browser support in 2026, photographic files roughly half the size of JPEG, and 10/12-bit HDR colour. For the format itself, see AVIF, and for matched-quality alpha comparisons see AVIF vs PNG.
Converting TGA for the web
The right target depends on whether the alpha channel must stay bit-exact:
- Choose AVIF for photographic or rendered TGA frames where smallest delivery size wins. AVIF's lossy alpha is visually transparent at sensible quality.
- Choose PNG when a mask or UI texture needs pixel-perfect lossless alpha integrity, then re-encode to AVIF only if size matters.
A practical two-step workflow:
- Decode TGA to PNG in any tool that reads it — GIMP, Photoshop, Affinity Photo, ImageMagick (
magick input.tga output.png), or Sharp via libvips all handle TGA. - Convert the PNG in your browser with no upload: Convert PNG to AVIF. For PNG sources already in hand, that route is the direct path; round-trip checks use Convert AVIF to PNG.
If your intermediate is JPEG instead, Convert JPG to AVIF and Convert AVIF to JPG cover that pair. AVIFify has no TGA converter, because TGA itself is not a web format — decode it once to PNG, then optimise. The AVIF Optimization guide covers quality settings for the final encode.
When to keep TGA
Keep TGA only inside the non-web pipelines that still expect it:
- A game engine or 3D tool that imports TGA as its source texture format.
- A render farm or video workflow whose convention is 32-bit TGA frames.
- A legacy or modding project where downstream tools accept nothing else.
For anything bound for a browser, convert. Use PNG for lossless alpha, JPG for legacy photo fallback, WebP as the broad-support web format, and AVIF for the smallest modern delivery.
FAQ
Can browsers open TGA files? No. No major browser decodes TGA, so it must be converted to PNG, WebP, or AVIF for web use.
Does TGA support transparency? Yes. A 32-bit TGA carries an 8-bit alpha channel; 16-bit TGA carries 1-bit alpha.
Is TGA lossless? Yes. TGA is uncompressed or losslessly RLE-compressed, but it is far larger than lossless PNG or AVIF.
Should I convert TGA to AVIF or PNG? Convert to AVIF for smallest size; convert to PNG when bit-exact lossless alpha is required.
Why is TGA still around? Game engines, 3D renderers, and video tools adopted it before PNG existed and kept it by convention.
Sources and further reading
- Truevision TGA — Wikipedia
- TGA File Format Summary — fileformat.info
- TGA (Targa) Files — Autodesk 3ds Max documentation
- AVIF format overview — the modern web replacement for TGA
- AVIF vs PNG — choosing the right transparent format