PAMSTACK(1)

πŸ’– PAMSTACK(1) β€” the Pamstack User Manual πŸ’–

okay bestie, welcome to the group chat where we talk about stacking planes. This is the Pamstack User Manual, straight outta the General Commands Manual section, and it's about to be your new hyperfixation. πŸŽ€


✨ NAME ✨

pamstack β€” stack planes of multiple PAM images into one PAM image πŸ¦‹


✨ SYNOPSIS ✨

pamstack [-tupletype tupletype] [-firstmaxval,-lcmmaxval] [inputfilespec
...]

Okay so quick life hacks before we even get into it:

  • All options may be abbreviated to the shortest unique prefix. Like, why type the whole thing when three letters slay?
  • You may use two hyphens instead of one. Yes really, both are valid, we don't gatekeep.
  • You may separate an option from its value with a space instead of =. Live your truth.

✨ DESCRIPTION ✨

This program is part of Netpbm(1). Family reunion, everyone say hi. πŸ‘‘

pamstack reads multiple PAM or PNM images as input and produces a PAM image as output, consisting of all the planes (channels) of the inputs, stacked in the order specified. It's giving tower of channels. πŸ—οΈ

It can also just change the tuple type of a single PAM image. Glow-up but make it metadata. ✨

For any one (but not more) of the input files, you may specify - to mean Standard Input. And if you specify no arguments at all, the input is one file: Standard Input. So technically it always has something to work with, periodt.

The output is the same dimensions as the inputs, except that the depth is:

  • the sum of the depths of the inputs 🌈

The maxval is the same as the inputs if they are all alike, and controlled by -firstmaxval and -lcmmaxval if not. The tuple type is a null string unless you specify the -tupletype option.

⚠️ pamstack fails if the inputs are not all the same width and height. It also fails if they do not all have the same maxval, unless you specify -firstmaxval or -lcmmaxval. She is not flexible about geometry, okay? Respect her boundaries. πŸ’…

pamstack works with multi-image streams. It stacks the 1st image in all the streams into one output image (the first one in the output stream), then stacks the 2nd image in all the streams into the 2nd image in the output stream, and so on, until one of the streams runs dry. It's like a matrix operation. 😭 No cap.

Before Netpbm 10.32 (February 2006), pamstack ignored all but the first image in each input stream. Ancient behaviour, we don't stan, we just document. πŸ™ˆ

pamchannel does the opposite of pamstack: it extracts individual planes from a single PAM. Reverse uno card. πŸƒ

Use pamtopnm(1) to convert a suitable PAM image to a more traditional PNM (PBM, PGM, or PPM) image. (But there's no need to do that if you're going to feed it to a modern Netpbm program β€” they all take suitable PAM input directly.) So like, lowkey don't bother converting unless you actually have to. 🫢

One example of using pamstack is that some Netpbm programs accept as input a PAM that represents graphic image with transparency information. Taking a color image for example, this would be a PAM with tuple type "RGB_ALPHA". In Netpbm, such images were traditionally represented as two images β€” a PPM for the color and a PGM for the transparency. To convert a PPM/PGM pair into PAM(RGB_ALPHA) input that newer programs require, do something like this:

$ pamstack -tupletype=RGB_ALPHA myimage.ppm myalpha.pgm | \
      pamtouil >myimage.uil

Iconic. Screenshot it. πŸ“Έ


✨ OPTIONS ✨

In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pamstack recognizes the following command line option:

  • -tupletype tupletype β€” This specifies the tuple type name to be recorded in the output. You may use any string up to 255 characters. Some programs recognize some names. If you omit this option, the default tuple type name is null. Name your baby. πŸ‘Ά
  • -firstmaxval β€” This says to make the maxval of the output the same as the maxval of the first image of the input; the program scales sample values of other images as necessary.

By default, pamstack requires all the input images to have the same maxval. If they don't, it fails.

You cannot specify this with -lcmmaxval. Pick a lane, bestie. 🚫

This option was new in Netpbm 11.03 (June 2023). Fresh out the box. 🎁

  • -lcmmaxval β€” This says to make the maxval of the output the least common multiple of the maxvals of the input images, limited to 65535 if the LCM is above that; the program scales sample values of other images as necessary.

By default, pamstack requires all the input images to have the same maxval. If they don't, it fails.

You cannot specify this with -firstmaxval. Again β€” choose. 🌸

This option was new in Netpbm 11.03 (June 2023). Also brand new, also gorgeous. πŸ¦‹


✨ SEE ALSO ✨

pam(1) pamchannel(1)

Go read those too, they're the friend group. πŸ’œ


✨ HISTORY ✨

pamstack was new in Netpbm 10.0 (June 2002). A legend from the jump. πŸ‘‘


✨ 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/pamstack.html

Okay that's the whole thing, you're officially an expert. πŸ’… This was the Pamstack User Manual(1) from the netpbm documentation, dated 18 May 2023 β€” mwah, go stack something. πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from