{
    "mode": "man",
    "parameter": "pamstack",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pamstack/1/json",
    "generated": "2026-08-13T08:02:03Z",
    "synopsis": "pamstack [-tupletype tupletype] [-firstmaxval,-lcmmaxval] [inputfilespec ...]\nAll  options  may  be abbreviated to the shortest unique prefix.  You may use two hyphens in‐\nstead of one.  You may separate an option from its value with a space instead of =.",
    "sections": {
        "NAME": {
            "content": "pamstack - stack planes of multiple PAM images into one PAM image\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pamstack [-tupletype tupletype] [-firstmaxval,-lcmmaxval] [inputfilespec ...]\n\nAll  options  may  be abbreviated to the shortest unique prefix.  You may use two hyphens in‐\nstead of one.  You may separate an option from its value with a space instead of =.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npamstack reads multiple PAM or PNM images as input and produces a PAM image as  output,  con‐\nsisting of all the planes (channels) of the inputs, stacked in the order specified.\n\nIt can also just change the tuple type of a single PAM image.\n\n\nFor  any  one  (but not more) of the input files, you may specify \"-\" to mean Standard Input.\nIf you specify no arguments at all, the input is one file: Standard Input.\n\nThe output is the same dimensions as the inputs, except that the depth is\nthe sum of the depths of the inputs.  The maxval is the same as the inputs\nif they are all alike, and controlled by -firstmaxval\nand -lcmmaxval if not.  The tuple type is a null string unless you\nspecify the -tupletype option.\n\n\npamstack fails if the inputs are not all the same width and height.  It also fails  if  they\ndo not all have the same maxval, unless you specify -firstmaxval or -lcmmaxval.\n\npamstack works with multi-image streams.  It stacks the 1st image in all the streams into one\noutput  image  (the  first  one  in  the output stream), then stacks the 2nd image in all the\nstreams into the 2nd image in the output stream, and so on, until one  of  the  streams  runs\ndry.  It's like a matrix operation.\n\nBefore  Netpbm  10.32 (February 2006), pamstack ignored all but the first image in each input\nstream.\n\npamchannel does the opposite of pamstack:  It extracts individual planes from a single PAM.\n\nUse pamtopnm(1) to convert a suitable PAM image to a more traditional PNM (PBM, PGM, or  PPM)\nimage.  (But there's no need to do that if you're going to feed it to a modern Netpbm program\n-- they all take suitable PAM input directly).\n\nOne  example of using pamstack is that some Netpbm programs accept as input a PAM that repre‐\nsents graphic image with transparency information.  Taking a color image  for  example,  this\nwould be a PAM with tuple type \"RGBALPHA\".  In Netpbm, such images were traditionally repre‐\nsented  as  two  images  -  a PPM for the color and a PGM for the transparency.  To convert a\nPPM/PGM pair into PAM(RGBALPHA) input that newer programs require, do something like this:\n\n$ pamstack -tupletype=RGBALPHA myimage.ppm myalpha.pgm | \\\npamtouil >myimage.uil\n\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "In addition to the options common to all programs based on libnetpbm  (most  notably  -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), pamstack recognizes the following command line option:\n\n\n\n",
            "subsections": [
                {
                    "name": "-tupletype _",
                    "content": "This  specifies  the  tuple  type  name to be recorded in the output.  You may use any\nstring up to 255 characters.  Some programs recognize some names.  If  you  omit  this\noption, the default tuple type name is null.\n\n"
                },
                {
                    "name": "-firstmaxval",
                    "content": "This  says  to make the maxval of the output the same as the maxval of the first image\nof the input; the program scales sample values of other images are as necessary.\n\nBy default, pamstack requires all the input images to have the same maxval.   If  they\ndon't, it fails.\n\nYou cannot specify this with -lcmmaxval.\n\nThis option was new in Netpbm 11.03 (June 2023).\n\n"
                },
                {
                    "name": "-lcmmaxval",
                    "content": "This says to make the maxval of the output the least common multiple of the maxvals of\nthe input images, limited to 65535 if the LCM is above that; the program scales sample\nvalues of other images are as necessary.\n\nBy  default,  pamstack requires all the input images to have the same maxval.  If they\ndon't, it fails.\n\nYou cannot specify this with -firstmaxval.\n\nThis option was new in Netpbm 11.03 (June 2023).\n\n\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pam(1) pamchannel(1)\n\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "pamstack was new in Netpbm 10.0 (June 2002).\n",
            "subsections": []
        },
        "DOCUMENT SOURCE": {
            "content": "This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/pamstack.html\n\nnetpbm documentation                         18 May 2023                     Pamstack User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pamstack - stack planes of multiple PAM images into one PAM image",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 are 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. This option was new in Netpbm 11.03 (June 2023)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 are 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. This option was new in Netpbm 11.03 (June 2023)."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pam",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pam/1/json"
        },
        {
            "name": "pamchannel",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamchannel/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Stack the planes of multiple PAM images into one PAM image.",
        "examples": [
            {
                "description": "Stack the planes of the specified PAM images in the specified order",
                "command": "pamstack {{path/to/image1.pam path/to/image2.pam ...}} > {{path/to/output.pam}}"
            },
            {
                "description": "Specify the tuple type name of the output PAM file (maximum of 255 characters)",
                "command": "pamstack {{-t|-tupletype}} {{tuple_type}} {{path/to/image1.pam path/to/image2.pam ...}} > {{path/to/output.pam}}"
            }
        ]
    }
}