HOME

TheInfoList



OR:

Truevision TGA, often referred to as TARGA, is a raster
graphics file format An Image file format is a file format A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be eit ...
created by Truevision Inc. (now part of Avid Technology). It was the native format of TARGA and VISTA boards, which were the first graphic cards for IBM-compatible PCs to support Highcolor/ truecolor display. This family of graphic cards was intended for professional computer image synthesis and video editing with PCs; for this reason, usual resolutions of TGA image files match those of the
NTSC The first American standard for analog television broadcast was developed by National Television System Committee (NTSC)National Television System Committee (1951–1953), Report and Reports of Panel No. 11, 11-A, 12–19, with Some supplement ...
and PAL video formats. TARGA is an acronym for '' Truevision Advanced Raster Graphics Adapter''; ''TGA'' is an
initialism An acronym is a word or name formed from the initial components of a longer name or phrase. Acronyms are usually formed from the initial letters of words, as in '' NATO'' (''North Atlantic Treaty Organization''), but sometimes use syllables, a ...
for '' Truevision Graphics Adapter''. TGA files commonly have the extension ".tga" on PC DOS/
Windows Windows is a group of several Proprietary software, proprietary graphical user interface, graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, W ...
systems and
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
(older
Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc Apple Inc. is an American multinational technology company headquartered in Cupertino, California, United States. Apple is ...
systems use the "TPIC"
type code The resource fork is a fork or section of a file on Apple An apple is an edible fruit In botany, a fruit is the seed-bearing structure in flowering plants that is formed from the ovary after flowering. Fruits are the means by ...
). The format itself permits any pixel bit depth up to 255, of which up to 15 bits can be dedicated to an
alpha channel In computer graphics Computer graphics deals with generating image An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey inform ...
; however, the only bit depths supported in practice were 8, 15, 16, 24, or 32, where the 16 and 32-bit formats used 1 and 8 bits respectively for the alpha channel. Color data can be color-mapped, or in direct color or truecolor format. Image data may be stored raw, or optionally, a lossless
RLE compression Run-length encoding (RLE) is a form of lossless data compression Lossless compression is a class of data compression In information theory Information theory is the scientific study of the quantification, storage, and communication ...
similar to PackBits can be employed. This type of compression performs poorly for typical photographic images, but works acceptably well for simpler images, such as icons, cartoons and line drawings.


History

The TGA file format was originally defined and specified by
AT&T AT&T Inc. is an American multinational telecommunications Telecommunication is the transmission of information by various types of technologies over wire, radio Radio is the technology of signaling and communicating using radio ...
EPICenter with feedback from Island Graphics Inc in 1984. AT&T EPICenter was an internal spin-off of AT&T created to market new technologies AT&T had developed for color frame buffers. What later became Truevision was the result of a leveraged employee buyout from AT&T in 1987. EPICenter's first two cards, the VDA (video display adapter) and ICB (image capture board), used the first incarnations of the TGA file format. The file extensions ".vda" and ".icb" implied information about the board specific data contained. It was later determined by Alan Wlasuk (then head of EPICenter), Brad Pillow (EPICenter) and Steven Dompier (Island's president) that a more codified file format was needed. The file format was created and implemented by Brad Pillow (EPICenter) and Bryan Hunt (EPICenter) and was developed in response to this need for a less board specific file format. A very simple extension was made to what was already in use, and contained information on width, height, pixel depth, an associated color map and image origin. A label field (up to 255 characters) was also included in the initial spec, but was rarely used. At the time, another technically superior file format called
TIFF Tag Image File Format, abbreviated TIFF or TIF, is an image file format An Image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for s ...
also appeared, but its use for true color images was very limited as the implementation and sharing of files between applications supporting the TIFF specification was rather difficult and involved. The TGA file format's simpler nature and portability between platforms is the main reason for its widespread adoption and its continued success in a wide variety of applications worldwide to this day. Initially the TGA file format was used in the ICB-PAINT and TARGA-PAINT programs (what later became known as TIPS) and for several projects in online real estate browsing and still-frame video teleconferencing. The current version (2.0) includes several enhancements such as "postage stamps" (better known as
thumbnail Thumbnails are reduced-size versions of pictures or video Video is an electronic medium for the recording, copying, playback, broadcasting, and display of moving visual media. Video was first developed for mechanical television s ...
s), an
alpha channel In computer graphics Computer graphics deals with generating image An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey inform ...
, gamma value, and textual
metadata Metadata is " data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive metadata – the descriptive ...
, and was authored by Truevision Inc.'s Shawn Steiner with direction from Kevin Friedly and David Spoelstra in 1989. At the time of its launching, it represented the state of the art in digital image processing. Even today, though its maximum
color depth Color depth or colour depth (see spelling differences), also known as bit depth, is either the number of bits used to indicate the color of a single pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smal ...
is not well suited for high-end pre-press, intensive image processing systems, TGA is still used extensively throughout the
animation Animation is a method by which still figures are manipulated to appear as moving images. In traditional animation, images are drawn or painted by hand on transparent celluloid sheets to be photographed and exhibited on film A fi ...
and
video Video is an electronic medium for the recording, copying, playback, broadcasting, and display of moving visual media. Video was first developed for mechanical television systems, which were quickly replaced by cathode-ray tube (CRT) ...
industry because its primary intended outputs are standard TV screens, not color printed pages. Uncompressed 24-bit TGA images are relatively simple compared to several other prominent 24-bit storage formats: A 24-bit TGA contains only an 18-byte header followed by the image data as packed RGB data. In contrast, BMP requires padding rows to 4-byte boundaries, while TIFF and PNG are
metadata Metadata is " data that provides information about other data", but not the content of the data, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive metadata – the descriptive ...
containers that do not place the image data or attributes at a fixed location within the file. 32-bit TGA images contain an alpha channel, or key signal, and are often used in
character generator A character generator, often abbreviated as CG, is a device or software that produces static or animated text (such as news crawls and credits rolls) for keying into a video Video is an electronic medium for the recording, copying, ...
programs such as Avid Deko.


Technical details

All values are
little-endian In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm In mathematics Mathematics is an area of knowledge th ...
; field and subfield numbers are per Version 2.0 of the specification. Version 2 added the extension area and footer. The developer area exists to store application-specific information.


Header

Image ID length (field 1) 0–255 The number of bytes that the image ID field consists of. The image ID field can contain any information, but it is common for it to contain the date and time the image was created or a serial number. As of version 2.0 of the TGA spec, the date and time the image was created is catered for in the extension area. Color map type (field 2) has the value: * 0 if image file contains no color map * 1 if present * 2–127 reserved by Truevision * 128–255 available for developer use Image type (field 3) is enumerated in the lower three bits, with the fourth bit as a flag for RLE. Some possible values are: * 0 no image data is present * 1 uncompressed color-mapped image * 2 uncompressed true-color image * 3 uncompressed black-and-white (grayscale) image * 9 run-length encoded color-mapped image * 10 run-length encoded true-color image * 11 run-length encoded black-and-white (grayscale) image Image type 1 and 9: Depending on the Pixel Depth value, image data representation is an 8, 15, or 16 bit index into a color map that defines the color of the pixel. Image type 2 and 10: The image data is a direct representation of the pixel color. For a Pixel Depth of 15 and 16 bit, each pixel is stored with 5 bits per color. If the pixel depth is 16 bits, the topmost bit is reserved for transparency. For a pixel depth of 24 bits, each pixel is stored with 8 bits per color. A 32-bit pixel depth defines an additional 8-bit alpha channel. Image type 3 and 11: The image data is a direct representation of grayscale data. The pixel depth is 8 bits for images of this type. Color map specification (field 4) has three subfields: * First entry index (2 bytes): index of first color map entry that is included in the file * Color map length (2 bytes): number of entries of the color map that are included in the file * Color map entry size (1 byte): number of bits per color map entry In case that not the entire color map is actually used by the image, a non-zero first entry index allows to store only a required part of the color map in the file. Image specification (field 5) has six subfields: * X-origin (2 bytes): absolute coordinate of lower-left corner for displays where origin is at the lower left * Y-origin (2 bytes): as for X-origin * Image width (2 bytes): width in pixels * Image height (2 bytes): height in pixels * Pixel depth (1 byte): bits per pixel * Image descriptor (1 byte): bits 3-0 give the alpha channel depth, bits 5-4 give pixel ordering Bit 4 of the image descriptor byte indicates right-to-left pixel ordering if set. Bit 5 indicates an ordering of top-to-bottom. Otherwise, pixels are stored in bottom-to-top, left-to-right order.


Image and color map data


Developer area (optional)

Version 1.0 of the TGA specification was very basic, and many developers had a need to store more information, and so opted to add on extra sections to their files, specific to their application only. In Version 2.0 of the specification, these application-specific enhancements/extras are supported by the developer area. Only the offset and size of the developer area are relevant to the spec, and developers are free to add whatever they want in the area. If a TGA decoder cannot interpret the information in the developer area, it will generally ignore it, since it is assumed to have been created by a different application. It is recommended that developers build logic into their applications to determine whether the data in the developer area is compatible with the application; one step towards this is to check the software ID in the file footer.


Extension area (optional)


File footer (optional)

If a TGA file contains a footer, it is likely to be a TGA version 2 file. The footer is the final 26 bytes of the file, of which the last 18 are constant.


Specification discrepancies

The older version of the TGA file format specification taken from the Appendix C of the Truevision Technical Guide states that run-length encoded (RLE) packets may cross scan lines: "For the run length packet, the header is followed by a single color value, which is assumed to be repeated the number of times specified in the header. The packet may cross scan lines (begin on one line and end on the next)". However, page 24 of the TGA v2.0 specification states the exact opposite: "Run-length Packets should never encode pixels from more than one scan line. Even if the end of one scan line and the beginning of the next contain pixels of the same value, the two should be encoded as separate packets. In other words, Run-length Packets should not wrap from one line to another". Consequently TGA readers need to be able to handle RLE data packets that cross scan lines since this was part of the original specification. However, when saving (creating) TGA files it will be necessary to limit RLE data packets to scanline boundaries in order to be compliant with the newer v2.0 TGA specification.


References


External links


TGA specification
– previous version of the file format taken from the Truevision Technical Guide
TrueVision TGA 2.0 conformance suite
– examples {{DEFAULTSORT:Truevision Tga Raster graphics file formats