| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 | <html><head><title>Pamtotga User Manual</title></head> |
| 3 | <body> |
| 4 | <h1>pamtotga</h1> |
| 5 | Updated: 06 November 2018 |
| 6 | <br> |
| 7 | <a href="#index">Table Of Contents</a> |
| 8 | |
| 9 | <h2>NAME</h2> |
| 10 | pamtotga - convert a Netpbm image to a TrueVision Targa file |
| 11 | |
| 12 | <h2 id="synopsis">SYNOPSIS</h2> |
| 13 | |
| 14 | <b>pamtotga</b> |
| 15 | [<b>-mono|-cmap|-cmap16|-rgb</b>] |
| 16 | [<b>-norle</b>] |
| 17 | [<b>-name=</b><i>name</i> |
| 18 | [<b>-verhose</b>] |
| 19 | [<i>pamfile</i>] |
| 20 | |
| 21 | <p>All options can be abbreviated to their shortest unique prefix. You |
| 22 | may use two hyphens instead of one to designate an option. You may |
| 23 | use either white space or equals signs between an option name and its |
| 24 | value. |
| 25 | |
| 26 | <h2 id="description">DESCRIPTION</h2> |
| 27 | |
| 28 | <p>This program is part of <a href="index.html">Netpbm</a>. |
| 29 | |
| 30 | <p><b>pamtotga</b> reads a PBM, PGM, PPM, or PAM image as input and |
| 31 | produces a TrueVision Targa file as output. The PAM image may be |
| 32 | either a BLACKANDWHITE, GRAYSCALE, RGB, or RGB_ALPHA image. |
| 33 | |
| 34 | <p>To create a TGA image with transparency (i.e. with a transparency mask), |
| 35 | use RGB_ALPHA PAM input. Some Netpbm programs that generate images with |
| 36 | transparency masks generate them in that format. For another way to create |
| 37 | the proper input stream, see <a href="pamstack.html"><b>pamstack</b></a>. |
| 38 | |
| 39 | <p>It is unclear that anything except <b>pamtotga</b> knows about TGAs |
| 40 | with transparency. The history behind this feature of <b>pamtotga</b> |
| 41 | is not clear. The format <b>pamtotga</b> produces is simply the same |
| 42 | as an ordinary RGB TGA image except with a 4th plane added for |
| 43 | transparency. The PixelSize field of the TGA header specifies 32 bits |
| 44 | instead of 24 and the raster has an extra byte added to each pixel, at |
| 45 | the tail end. The value of that byte has the same meaning as in a PAM |
| 46 | image with maxval 255. |
| 47 | |
| 48 | <h2 id="options">OPTIONS</h2> |
| 49 | |
| 50 | <p>In addition to the options common to all programs based on libnetpbm |
| 51 | (most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> |
| 52 | Common Options</a>), <b>pamtotga</b> recognizes the following |
| 53 | command line options: |
| 54 | |
| 55 | <dl compact> |
| 56 | <dt><b>-cmap</b> |
| 57 | <dd> |
| 58 | Make output Targa file use a color map (palette) to make the output smaller. |
| 59 | <p> |
| 60 | Each color in the color map is 3 bytes, 8 bits each of red, green, and blue, |
| 61 | unless the input is black and white or grayscale, in which case each color in |
| 62 | the palette is represented by one byte. |
| 63 | |
| 64 | <p>Input must contain no more than 256 distinct colors and must not contain |
| 65 | transparency information. |
| 66 | |
| 67 | <p>(The transparency limitation is not a limitation of the format, but |
| 68 | of <b>pamtotga</b>. Implementing a color map that contains transparency |
| 69 | information is harder to implement). |
| 70 | |
| 71 | <dt><b>-cmap16</b> |
| 72 | <dd> |
| 73 | Same as <b>-cmap</b>, except a color map entry for full color input is 5 |
| 74 | bits each of red, green, and blue, stored as two bytes (16 bits). |
| 75 | |
| 76 | <p>Restrictions are the same as for <b>-cmap</b>. |
| 77 | |
| 78 | <p>This option was new in Netpbm 10.85 (December 2018). |
| 79 | |
| 80 | <dt><b>-mono</b> |
| 81 | <dd> |
| 82 | Make output Targa file of type 8 bit monochrome. Input must be PBM or PGM |
| 83 | or a PAM with BLACKANDWHITE or GRAYSCALE tuple type. |
| 84 | See <b>-cmap</b>. |
| 85 | |
| 86 | <p>You may specify at most one of <b>-mono</b>, <b>-cmap</b>, and |
| 87 | <b>-rgb</b>. If you specify neither, the default image type is the |
| 88 | most highly constrained compatible type is used, where monochrome is |
| 89 | more constrained than colormapped which is in turn more constrained |
| 90 | than unmapped. |
| 91 | |
| 92 | <dt><b>-rgb</b> |
| 93 | <dd> |
| 94 | Make output Targa file of type 24 bit unmapped color. See <b>-cmap</b>. |
| 95 | |
| 96 | <dt><b>-norle</b> |
| 97 | <dd>Do not use run-length encoding in the output Targa file. |
| 98 | Run-length encoded files are smaller, but Some Targa readers can't |
| 99 | read run-length encoded files. |
| 100 | |
| 101 | <dt><b>-name=</b><i>name</i> |
| 102 | |
| 103 | <dd>This is the value for the image ID stated in the header of the TGA |
| 104 | output file. <b>pamtotga</b> truncates it as necessary to meet TGA |
| 105 | standards. |
| 106 | |
| 107 | <p>By default, <b>pamtotga</b> uses the input file name argument, up to |
| 108 | the first period (or the whole thing if there is no period). It truncates |
| 109 | it as necessary to meet TGA standards. If you specify (or default to) |
| 110 | Standard Input, <b>pamtotga</b> omits the image ID from the TGA header. |
| 111 | |
| 112 | <dt><b>-verbose</b> |
| 113 | <dd>This causes <b>pamtotga</b> to issues messages about the conversion |
| 114 | process. |
| 115 | |
| 116 | |
| 117 | </dl> |
| 118 | |
| 119 | <h2 id="seealso">SEE ALSO</h2> |
| 120 | |
| 121 | <a href="tgatoppm.html">tgatoppm</a>, |
| 122 | <a href="pnmquant.html">pnmquant</a>, |
| 123 | <a href="pamstack.html">pamstack</a>, |
| 124 | <a href="pam.html">pam</a> |
| 125 | <a href="pnm.html">pnm</a> |
| 126 | |
| 127 | <h2 id="history">HISTORY</h2> |
| 128 | |
| 129 | <p>This program was called <b>ppmtotga</b> until Netpbm 10.6 (July 2002). |
| 130 | That was always a misnomer, though, because a PPM class program would not be |
| 131 | able to tell the difference between PGM and PPM input (it would all look like |
| 132 | PPM), and thus could not choose the output Targa image type based on the type |
| 133 | of the input. Netpbm 10.6 also added the ability to handle a transparency |
| 134 | channel, so it became a PAM class program. |
| 135 | |
| 136 | <p>In Netpbm 10.15 (April 2003), the program became the first in the |
| 137 | Netpbm package to recognize a transparency channel in a PAM. It recognized |
| 138 | tuple type "RGBA". But when this kind of PAM image was later |
| 139 | added to the PAM specification, it was specified with tuple type |
| 140 | "RGB_ALPHA". So in Netpbm 10.26 (January 2005), <b>pamtotga</b> |
| 141 | changed to recognize "RGB_ALPHA" instead of "RGBA". |
| 142 | |
| 143 | <h2 id="author">AUTHOR</h2> |
| 144 | |
| 145 | Copyright (C) 1989, 1991 by Mark Shand and Jef Poskanzer. |
| 146 | |
| 147 | <hr> |
| 148 | <h2 id="index">Table Of Contents</h2> |
| 149 | <ul> |
| 150 | <li><a href="#synopsis">SYNOPSIS</a> |
| 151 | <li><a href="#description">DESCRIPTION</a> |
| 152 | <li><a href="#options">OPTIONS</a> |
| 153 | <li><a href="#seealso">SEE ALSO</a> |
| 154 | <li><a href="#history">HISTORY</a> |
| 155 | <li><a href="#author">AUTHOR</a> |
| 156 | </ul> |
| 157 | </body> |
| 158 | </html> |