A file with .tga extension is a raster graphic format and was created by Truevision Inc. It was designed for the TARGA (Truevision Advanced Raster Adapter) boards and provided Highcolor/truecolor display support for IBM-compatible PCs. It supports 8, 16, 24 and 32 bits per pixel and 8-bit alpha channel. It also supports lossless RLE compression that can be applied to reduce the image size. Digital photos and textures use the TGA image format.
Formation of TGA file format came into being in 1984 by AT&T EPICenter (later extracted and formed as an independent entity known as Truevision) that was working on marketing of new technologies developd by AT&T for color frame buffers. EPICenter was already working on its first two cards, the VDA (Video Display Adapter) and ICB (image capture board) for which work on two file types, .vda and .icb, was already in process. These file formats were codified and less broad specific file format TGA was introduced. TGA was an extension to what was already in use, and provided information such as width, height, pixel depth, associated color map and image origin.
TGA’s 2.0 version, published in 1989, incorporated several enhanced features such as:
Prime contributors to TGA’s 2.0 version include Truevision’s Shawn Steiner, Kevin Fiedly and David Spoelstra.
TGA TARGA File Format Specifications
A TGA file consists of 2 main parts:
Colour Pixel information
All the values in a TGA file are in littl-endian as per the format specifications.
A TGA file header consists of the following 5 fields.
Length of the image ID field (0-255)
Color map type
Whether a color map is included (0 - indicates that no color-map data is included with this image. 1 - indicates that a color-map is included with this image.)
Compression and color types (0- No Image Data Included. 1- Uncompressed, Color mapped image, 2- Uncompressed, True Color Image, 9- Run-length encoded, Color mapped image, 11- Run-Length encoded, Black and white image)
Color map specification
Describes the color map
Image dimensions and format
Image and Color Map Data
From image ID length field
Optional field containing identifying information
From color map specification field
Color map data
Look-up table containing color map data
From image specification field
Stored according to the image descriptor
Developer Area (Optional)
TGA Version 2.0 provides support for additional enhancements/extras which many developers wanted to store more information. The information is optional so that if a TGA decoder is not able to interpret it, it will be ignored.
Extension Area (Optional)
Size in bytes of the extension area, always 495
Name of the author. If not used, bytes should be set to NULL (\0) or spaces
A comment, organized as four lines, each consisting of 80 characters plus a NULL
Date and time at which the image was created
Hours, minutes and seconds spent creating the file (for billing, etc.)
The application that created the file.
Pixel aspect ratio
Color correction offset
Number of bytes from the beginning of the file to the color correction table if present
Number of bytes from the beginning of the file to the postage stamp image if present
Scan line offset
Number of bytes from the beginning of the file to the scan lines table if present
Specifies the alpha channel
File Footer (Optional)
The last 26 bytes of the file represent the footer, which if present means its likely a TGA version 2 file.