Inside TGA Image Files: Raster Graphics, Color Depth, and Creative Workflows
Article Nov 29, 2026

Inside TGA Image Files: Raster Graphics, Color Depth, and Creative Workflows

M Seemab

M Seemab

Content Creator & Editor

TGA image files, also called Targa files, use a simple raster format that stores pixels either uncompressed or with run-length encoding, in color-mapped, grayscale, or true-color layouts, and supports an 8-bit alpha channel. It is lossless, easy for software to read and write, and common in game development, 3D rendering, animation, and video work, but browsers do not display it, and files are larger than PNG.
Truevision introduced the format in 1984 for its TARGA graphics boards, which were among the first affordable cards able to display and capture true-color video. The hardware is long gone, yet the file format stayed because tools could implement it in a few lines of code, and because it carries alpha. This guide covers the structure of a TGA file, its color options, its quirks, and the reasons creative pipelines still reach for it.

Key Points

  • TGA files have an 18-byte header followed by an optional ID, color map, and pixel data.
  • Image types include color-mapped, true-color, and grayscale, each uncompressed or run-length encoded.
  • True-color files commonly use 24 bits for RGB or 32 bits for RGBA, with 15- and 16-bit variants.
  • Compression is optional, lossless, and simple, so files are usually larger than PNG.
  • Origin flags and premultiplied alpha are frequent sources of flipped or fringed images.
  • Convert TGA to PNG for sharing or archiving.
KEY TAKEAWAY
“TGA persists in creative pipelines because tools agree on it. It is a plain, lossless handshake between programs, not a clever compressor.”

Structure of a TGA File

A TGA begins with a fixed 18-byte header. It records the length of an optional ID field, whether a color map is present, the image type, the color map specification, the image origin, width, height, bits per pixel, and an image descriptor byte. After the header come the optional ID field, the optional color map, and the pixel data. Version 2.0, introduced in 1989 and documented in 1991, added a footer ending with the signature TRUEVISION-XFILE and optional areas for developer data and an extension block holding author, comments, gamma and similar information.
Part
Size
Purpose
Header18 bytesImage type, dimensions, bits per pixel, origin and descriptor
Image IDOptional, up to 255 bytesFree-form identification text
Color mapOptionalPalette for color-mapped images
Pixel dataMost of the fileRaw or run-length encoded pixels
Extension and developer areasOptional (version 2.0)Author, gamma, comments, thumbnail and custom data
Footer26 bytes (version 2.0)Pointers and the TRUEVISION-XFILE signature

Image Types, Color Depth and Channel Order

Image type
Description
Typical use
Color-mappedPixels index a paletteOld graphics and small assets
True-color15, 16, 24 or 32 bits per pixelTextures and renders
Grayscale8 bits per pixelMasks and height maps
Run-length encoded variantsSame layouts with simple compressionFlat-color images
Color channels are stored in blue, green, red order, with alpha last in 32-bit files. The image descriptor byte tells software whether pixel rows begin at the top or the bottom of the picture and whether they run left to right. Programs that ignore these bits show images upside down or mirrored, which is the most common TGA complaint.

Compression and File Size

Uncompressed TGA files are as large as BMP files: width times height times bytes per pixel. Run-length encoding stores runs of identical pixels as a count and a value, which helps flat-color artwork and can even enlarge noisy images. Both options are lossless. Compared with PNG, which filters the data and applies DEFLATE compression, TGA is usually larger for the same pixels, which is why PNG is better for storage and sharing.
Format
Compression
Size for the same pixels
Alpha
TGA uncompressedNoneLargestYes, 8-bit in 32-bit files
TGA RLERun-lengthSmaller only for flat imagesYes
PNGFiltering plus DEFLATEUsually much smallerYes, 8 or 16 bits
BMPUsually noneLargeUnreliable

Alpha Channel and Premultiplication

A 32-bit TGA stores 8 bits of alpha with each pixel, which supports smooth transparency and is the main reason artists use it for sprites, decals, particle textures, and compositing elements. A historical ambiguity concerns whether the color values are premultiplied by alpha. Version 2.0 added a field to say so, but many files omit it, so check how the receiving program interprets alpha. Wrong assumptions produce dark or bright fringes at transparent edges.

Why Creative Workflows Still Use TGA

  • Game textures and sprites: many engines import TGA and convert it to GPU-compressed formats for shipping.
  • 3D rendering: renderers export frame sequences or passes with alpha as TGA.
  • Video and broadcast graphics: titles and overlays with alpha pass between editing tools.
  • Legacy and in-house tools: many pipelines expect it, and nobody changes what works.
In engines such as Unity and Unreal, a TGA is a source asset, not a delivery format. The engine imports it and creates optimized textures, so the original TGA never reaches the player.

Compatibility

TGA opens in Photoshop, GIMP, Blender, Maya, Unity, Unreal Engine, viewers such as IrfanView and XnView, and macOS Preview. Windows has no universal built-in viewer for every TGA variant, and browsers do not display it. Unusual variants, such as color-mapped or 15-bit files, may open incorrectly in simpler programs.

Advantages and Disadvantages

Advantages
Disadvantages
Very simple to read and writeLarger files than PNG
Lossless storage, with optional run-length encodingNo browser support
8-bit alpha channelWeak compression and limited metadata
Supported across 3D, game and video softwareOrigin and premultiplied alpha ambiguities
Predictable layout for pipelinesVariants can confuse simple viewers

TGA Compared With Related Formats

  • TGA and PNG: PNG is smaller, universally viewable, and supports 16-bit channels, while TGA is simpler for engines. See the PNG guide.
  • TGA and BMP: both are plain raster formats, but TGA has dependable alpha. See the BMP guide.
  • TGA and PSD: PSD stores editable layers, whereas TGA stores one flat image. See the PSD guide.

Converting TGA Files

The SnapZain Image Format Converter does not list TGA among its accepted inputs or outputs. Use an image editor, Blender, ImageMagick, or a game tool to convert. PNG is normally the best lossless replacement because it keeps alpha at a smaller size, and JPG suits previews that do not need transparency. Once you have a PNG or JPG, SnapZain can convert it onward among its supported formats, for example to WebP.
  • TGA to PNG: lossless and smaller; confirm that origin and premultiplied alpha were handled correctly.
  • TGA to JPG: lossy and drops alpha, so use it for thumbnails and previews only.
  • PNG to TGA: only when the destination software needs it.

Getting a TGA Ready for the Web

Step
Action
Note
1Open the TGA and confirm orientation and alphaFix flips before exporting
2Export a PNG at full sizeKeeps lossless pixels and alpha
3Resize to the dimensions you will displayReduces weight
4Optionally convert the PNG to WebPSmaller delivery file
5Add alt text and width and height attributesAccessibility and layout stability
Keep the TGA as the pipeline asset and publish only the derived files.

Import Settings in Game Engines

Setting
What it controls
Common mistake
sRGBWhether color is treated as gamma-encodedMarking data maps such as normals as sRGB
Alpha sourceWhich channel supplies transparencyLeaving alpha unused or misread
CompressionGPU texture format created from the TGAOver-compressing UI art
MipmapsPre-scaled smaller copies for distanceDisabling them on 3D textures
Maximum sizeLargest imported dimensionShipping oversize textures
It is also worth setting a naming convention for TGA assets, for example, including the channel layout and color space in the file name. When an artist hands a texture to a programmer, a name such as wall_albedo_srgb_rgba removes the guesswork that otherwise causes flipped, fringed, or wrongly tinted materials in the engine.

Common TGA Mistakes

  • Seeing a flipped image: a viewer ignored the origin flag; use another program or flip it during conversion.
  • Dark or bright edge fringes: premultiplied alpha was misread; adjust the import setting.
  • Sending TGA to clients: deliver PNG or JPG instead.
  • Expecting run-length encoding to shrink everything: it helps flat images only.

Conclusion

TGA persists because pipelines like it: simple, lossless, and carrying alpha. Use it as a working asset where tools expect it, and convert to PNG, JPG, or web formats for everything else. Knowing its origin and alpha quirks removes most of the surprises.

Frequently Asked Questions

When was TGA introduced and what was it for?

Truevision introduced it in 1984 for its TARGA graphics boards, which captured and displayed true-color video and images.

Which viewers handle TGA files properly?

Photoshop, GIMP, Blender, IrfanView, XnView, and macOS Preview open most variants. Simple viewers may mishandle flipped origins or color-mapped files.

Do I lose quality if I save a TGA with run-length encoding?

No. Run-length encoding is lossless, so pixels stay identical. It only changes how repeated pixels are stored.

Which TGA type carries alpha?

32-bit true-color TGA files carry an 8-bit alpha channel with each pixel.

Why are TGA files so large?

They are often uncompressed, and run-length encoding helps only for flat images. PNG usually compresses the same pixels much better.

Which TGA header bits control image orientation?

The image descriptor byte holds origin flags that say whether rows begin at the top or bottom and which side they start on. Programs that ignore them show flipped images.

Are TGA files used in modern games?

Yes, as source textures and sprites in many pipelines. Engines usually convert them to GPU-compressed formats before shipping.

Can a TGA store animation or several frames?

No. A TGA holds one image, so frame sequences are saved as numbered files.

Are TGA and TARGA different formats?

No. TARGA was the hardware product name, and TGA is the file extension of the same format.

What is the TRUEVISION-XFILE signature?

A marker at the end of version 2.0 files that tells software the extension and developer areas are present.

What is premultiplied alpha?

The color values are already multiplied by the alpha value. Wrong handling produces dark or bright fringes at transparent edges.

Which TGA bit depths should I use?

Use 24-bit for opaque color and 32-bit when you need alpha. The 15- and 16-bit variants are rare and may be mishandled by simple viewers.

Why does a TGA with alpha look wrong inside a game engine?

Engines have import settings for the alpha source, sRGB handling, and compression. Check that alpha is treated as transparency and that color textures use sRGB while data maps do not.

Does TGA support color profiles?

Not in a standard, widely used way. The extension area has a gamma field, but color management is limited compared with PNG or TIFF.

Is TGA good for textures?

It is a convenient lossless source format with alpha. Engines convert it into optimized texture formats for runtime.

Can I use TGA on a website?

Browsers do not display it. Convert to PNG, WebP, or JPG for the web.

What does run-length encoding do?

It stores repeated identical pixels as a count and a value, which saves space on flat artwork.

Why would I choose PNG over TGA?

PNG is smaller, supports 16-bit channels, is displayed everywhere, and carries color profiles.

What is a good order of steps to move a TGA onto the web?

Export a PNG from your editor, resize it to the display size, optionally convert it to WebP, and add alt text and dimensions on the page.

How large can a TGA canvas be?

The header stores width and height in 16 bits each, so up to 65,535 pixels per side, though software may impose lower limits.

Are 15-bit and 16-bit TGAs common?

They are rare today. Most files are 24-bit or 32-bit, and simple viewers may mishandle the smaller depths.

Share this article

Join the Conversation