PAMTOTGA(1)

πŸ“¦
version 11.13.03 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… pamtotga, bestie

okay so this is the Pamtotga User Manual page, from the General Commands Manual section β€” yes the title repeats itself, that's just how man pages are, iconic behavior honestly 🫢


✨ NAME ✨

pamtotga β€” convert a Netpbm image to a TrueVision Targa file


πŸŽ€ SYNOPSIS πŸŽ€

pamtotga [-mono|-cmap|-cmap16|-rgb] [-norle] [-name=name [-verhose]
[pamfile]

okay so small print, but important print, no cap:

  • every option can be abbreviated to its shortest unique prefix β€” type less, slay more πŸ’…
  • you can use two hyphens instead of one to designate an option
  • and you can use either white space or equals signs between an option name and its value

🌸 DESCRIPTION 🌸

This program is part of Netpbm(1), the whole little family. 🧚

pamtotga reads a PBM, PGM, PPM, or PAM image as input and spits out a TrueVision Targa file as output. The PAM image may be either a BLACKANDWHITE, GRAYSCALE, RGB, or RGB_ALPHA image.

So you want transparency?? A transparency mask?? Girl, same. 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. And if you want another way to create the proper input stream, go look at pamstack(1).

Now, real talk 🫠 β€” it is unclear that anything except pamtotga knows about TGAs with transparency. The history behind this feature of pamtotga is not clear either. 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 πŸ’–

So on top of the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamtotga recognizes the following command line options:

  • -cmap β€” Make the output Targa file use a color map (aka a palette) so the output is 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. The input must contain no more than 256 distinct colors and must not contain transparency information. (And before you come for the format: the transparency limitation is not a limitation of the format, it's a limitation of pamtotga. Implementing a color map that contains transparency information is harder to implement. It's giving "skill issue but we're being honest about it" 😭)
  • -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). The restrictions are the same as for -cmap. This option was new in Netpbm 10.85 (December 2018). ✨
  • -mono β€” Make the 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, where monochrome is more constrained than colormapped, which is in turn more constrained than unmapped. (Ranked, bestie. There's a whole hierarchy here. πŸ‘‘)
  • -rgb β€” Make the 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. So like, choose your fighter. 🀷
  • -name=name β€” This is the value for the image ID stated in the header of the TGA output file. pamtotga truncates it as necessary to meet TGA standards. By default, pamtotga uses 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. And if you specify (or default to) Standard Input, pamtotga omits the image ID from the TGA header. 🫢
  • -verbose β€” This causes pamtotga to issue messages about the conversion process. (Narrator voice, but make it TGA. πŸ”₯)

🌈 SEE ALSO 🌈

tgatoppm(1), pnmquant(1), pamstack(1), pam(1), pnm(1)


πŸ“œ HISTORY πŸ“œ

so the lore is real:

This program was called ppmtotga until Netpbm 10.6 (July 2002). And that was always a misnomer, though, because a PPM class program would not be able to tell the difference between PGM and PPM input (it would all look like PPM), and thus could not choose the output Targa image type based on the type of the input. Netpbm 10.6 also added the ability to handle a transparency channel, so it became a PAM class program. glow up fr πŸ’…

In Netpbm 10.15 (April 2003), the program became the first in the Netpbm package to recognize a transparency channel in a PAM. It recognized tuple type "RGBA". But when this kind of PAM image was later added to the PAM specification, it was specified with tuple type "RGB_ALPHA". So in Netpbm 10.26 (January 2005), pamtotga changed to recognize "RGB_ALPHA" instead of "RGBA". Character development. 🌱


πŸ‘‘ AUTHOR πŸ‘‘

Copyright (C) 1989, 1991 by Mark Shand and Jef Poskanzer.


πŸ¦‹ 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

ok that's the whole page, you're welcome, go make some TGAs πŸ’–

kisses, this was the netpbm documentation, dated 06 November 2018, and the page calls itself the Pamtotga User Manual(1). slay, periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from