This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

TGA (.tga)

Common MIME types: application/tga, image/tga, image/tga
Truevision TARGA format.
Raster image file format.
Widely used in animation and video applications.
Was native format of TARGA video cards.
Binary format.
Supports color-mapped and true-color raster images.
Can compress data using a run-length encoding method.
Supports alpha channels.
Introduced by Truevision in 1984, updated as Version 2.0 in 1989.
  • Import and Export fully support Version 2.0 of the TGA format.
  • Import imports a TGA file and returns an image.
  • Export exports an image, graphics, or any other expression as a raster image to TGA.
  • When exporting Mathematica graphics or arbitrary expressions to TGA, the resulting image has the same raster size as its displayed form.
  • Image objects are by default exported at their raster size.
  • Because TGA is a raster image format, all fonts are rasterized on export.
  • Import imports the specified element from TGA.
  • Import imports multiple elements.
  • Export creates a TGA file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Data"array of color values
"Graphics"Graphics object representing an image
"GrayLevels"array of normalized gray-level values
"Image"raster image represented as an Image object
"RGBColorArray"array of RGBColor objects
"BitDepth"bits used to represent each color channel in the file
"ColorSpace"color encoding used in the file
"ImageSize"raster dimensions
  • General option:
ImageSizeAutomaticoverall image size
Import a TGA file as an image:
Export a raster image to TGA:
Import a TGA file as an image:
Click for copyable input
Export a raster image to TGA:
Click for copyable input