pamtotga1
Convert a netpbm image to a truevision targa file
Usage
pamtotga [-mono|-cmap|-cmap16|-rgb] [-norle] [-name=name [-verhose] [pamfile]
All options can be abbreviated to their shortest unique prefix. You may use two hyphens instead of one to designate an option. You may use either white space or equals signs between an option name and its value.
Overview
This program is part of Netpbm(1) .
pamtotga reads a PBM, PGM, PPM, or PAM image as input and produces a TrueVision Targa file as output. The PAM image may be either a BLACKANDWHITE, GRAYSCALE, RGB, or RGB_ALPHA image.
To create a TGA image with transparency (i.e. with a transparency mask), use RGB_ALPHA PAM input. Some Netpbm programs that generate images with transparency masks generate them in that format. For another way to create the proper input stream, see pamstack(1) .
It is unclear that anything except pamtotga knows about TGAs with transparency. The history behind this feature of pamtotga is not clear. The format pamtotga produces is simply the same as an ordinary RGB TGA image except with a 4th plane added for transparency. The PixelSize field of the TGA header specifies 32 bits instead of 24 and the raster has an extra byte added to each pixel, at the tail end. The value of that byte has the same meaning as in a PAM image with maxval 255.
Options
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see
Common Options ⟨index.html#commonoptions⟩ ), pamtotga recognizes the following command line options:
-
-cmap -
Make output Targa file use a color map (palette) to make the output smaller.
Each color in the color map is 3 bytes, 8 bits each of red, green, and blue, unless the input is black and white or grayscale, in which case each color in the palette is represented by one byte.
Input must contain no more than 256 distinct colors and must not contain transparency information.
(The transparency limitation is not a limitation of the format, but of
pamtotga. Implementing a color map that contains transparency information is harder to implement).
-
-cmap16 -
Same as
-cmap, except a color map entry for full color input is 5 bits each of red, green, and blue, stored as two bytes (16 bits).Restrictions are the same as for
-cmap.This option was new in Netpbm 10.85 (December 2018).
-
-mono -
Make output Targa file of type 8 bit monochrome. Input must be PBM or PGM or a PAM with BLACKANDWHITE or GRAYSCALE tuple type. See
-cmap.You may specify at most one of
-mono,-cmap, and-rgb. If you specify neither, the default image type is the most highly constrained compatible type is used, where monochrome is more constrained than colormapped which is in turn more constrained than unmapped.
-
-rgb -
Make output Targa file of type 24 bit unmapped color. See
-cmap.
-
-norle -
Do not use run-length encoding in the output Targa file. Run-length encoded files are smaller, but Some Targa readers can't read run-length encoded files.
-
-name=name -
This is the value for the image ID stated in the header of the TGA output file.
pamtotgatruncates it as necessary to meet TGA standards.By default,
pamtotgauses the input file name argument, up to the first period (or the whole thing if there is no period). It truncates it as necessary to meet TGA standards. If you specify (or default to) Standard Input,pamtotgaomits the image ID from the TGA header.
-
-verbose -
This causes
pamtotgato issues messages about the conversion process.
Document source
This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at
-
http://netpbm.sourceforge.net/doc/pamtotga.html
Releases
3 releases since Debian 12 (Bookworm); the text changed 1 time.