{
    "mode": "man",
    "parameter": "pamundice",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/pamundice/json",
    "generated": "2026-10-04T23:33:38Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "pamundice - combine grid of images (tiles) into one\n\n",
            "subsections": []
        },
        "EXAMPLE": {
            "content": "$ pamdice myimage.ppm -outstem=myimagepart -width=10 -height=8\n$ pamundice myimagepart%1d%1a.ppm -across=10 -down=8 >myimage.ppm\n\n$ pamundice myimage.ppm myimagepart%2a -across=13 -hoverlap=9\n\n\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "pamundice",
                    "content": "[-across=n]\n\n[-down=n]\n\n[-hoverlap=pixels]\n\n[-voverlap=pixels]\n\n[-verbose]\n\n{inputfilenamepattern, -listfile=filename}\n\nYou  can use the minimum unique abbreviation of the options.  You can use two hyphens instead\nof one.  You can separate an option name from its value with white space instead of an equals\nsign.\n\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npamundice reads a bunch of Netpbm images as input and combines them as a grid of tiles into a\nsingle output image of the same kind on Standard Output.\n\nYou can optionally make the pieces overlap.\n\nThe images can either be in files whose names indicate where they go in the\noutput (e.g. 'myimagepart0304' could be the image for Row 3,\nColumn 4 - see the inputfilenamepattern argument) or listed in a\nfile, with a -listfile option.\n\nThe input images must all have the same format (PAM, PPM, etc.)  and maxval and for PAM  must\nhave  the same depth and tuple type.  All the images in a rank (horizontal row of tiles) must\nhave the same height.  All the images in a file (vertical column of tiles) must have the same\nwidth.  But it is not required that every rank have the same height or every  file  have  the\nsame width.\n\npamdice  is the inverse of pamundice.  You can use pamundice to reassemble an image sliced up\nby pamdice.  You can use pamdice to recreate the tiles of an image created by pamundice,  but\nto  do  this, the original ranks must all have been the same height except for the bottom one\nand the original files must all have been the same width except the right one.\n\nOne use for this is to process an image in pieces when  the  whole  image  is  too  large  to\nprocess.   For  example,  you might have an image so large that an image editor can't read it\nall into memory or processes it very slowly.  You can  split  it  into  smaller  pieces  with\npamdice, edit one at a time, and then reassemble them with pamundice.\n\nOf  course,  you  can also use pamundice to compose various kinds of checkerboard images, for\nexample, you could write a program to render a chessboard  by  computing  an  image  of  each\nsquare, then using pamundice to assemble them into a board.\n\n\nAn  alternative to join images in a single direction (i.e. a single rank or a single file) is\npamcat.  pamcat gives you more flexibility than pamundice in identifying  the  input  images:\nyou can supply them on Standard Input or as a list of arbitrarily named files.\n\nTo  join  piecewise  photographs,  use pnmstitch instead of pamundice, because it figures out\nwhere the pieces overlap, even if they don't overlap exactly vertically or horizontally.\n\nTo create an image of the same tile repeated in a grid, that's pnmtile.\n\npnmindex does a similar thing to pamundice: it combines a bunch of small  images  in  a  grid\ninto  a  big one.  But its purpose is to produce a an index image of the input images.  So it\nleaves space between them and has labels for them, for example.\n\n\n",
            "subsections": []
        },
        "ARGUMENTS": {
            "content": "Unless you use a -listfile option,, there is one non-option argument, and  it  is  mandatory:\ninputfilenamepattern.  This tells pamundice what files contain the input tiles.\n\npamundice  reads  the  input  images from files which are named with a pattern that indicates\ntheir positions in the combined image.  For example, tile0005.ppm could  be  the  6th  tile\nover in the 1st rank, while tile0401 is the 2nd tile over in the 5th rank.\n\nYou  cannot supply any of the data on Standard Input, and the files must be the kind that pa‐\nmundice can close and reopen and read the same image a second time (e.g. a  regular  file  is\nfine; a named pipe is probably not).\n\ninputfilenamepattern is a printf-style pattern.  (See the standard C library printf subrou‐\ntine).   For  the  example above, it would be tile%2d%2a.ppm.  The only possible conversion\nspecifiers are:\n\n\n\n\nd      \"down\": The rank (row) number, starting with 0.\n\n\na      \"across\": The file (column) number, starting with 0.\n\n\n%      The per cent character (%).\n\n\n\nThe number between the % and the conversion specifier is the precision and is  required.   It\nsays how many characters of the file name are described by that conversion.  The rank or file\nnumber is filled with leading zeroes as necessary.\n\nSo  the  example tile%2d%2a.ppm means to get the name of the file that contains the tile at\nRank 0, File 5, you:\n\n\n\n\n•      replace the \"%2d\" with the rank number, as a 2 digit decimal number: \"00\"\n\n\n•      Replace the \"%2a\" with the file number, as a 2 digit decimal number: \"05\"\n\n\nNote that this pattern describes file names that pamdice produces, except that the  precision\nmay be more or less.  (pamdice uses however many digits are required for the highest numbered\nimage).\n\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee  Common Options ), pamundice recognizes the following command line options:\n\n\n",
            "subsections": [
                {
                    "name": "-across=_",
                    "content": "This is the number of tiles across in the grid, i.e. the number of tiles in each rank,\nor the number of files.\n\nDefault is 1.\n\n\n"
                },
                {
                    "name": "-down=_",
                    "content": "This is the number of tiles up and down in the grid, i.e. the number of tiles in  each\nfile, or the number of ranks.\n\nDefault is 1.\n\n"
                },
                {
                    "name": "-hoverlap=_",
                    "content": "This  is the amount in pixels to overlap the tiles horizontally.  pamundice clips this\nmuch off the right edge of every tile before joining it to the adjacent image  to  the\nright.  The tiles along the right edge remain whole.\n\nThere must not be any input image narrower than this.\n\nNote that this undoes the effect of the same -hoverlap option of pamdice.\n\nDefault is zero -- no overlap.\n\n"
                },
                {
                    "name": "-voverlap=_",
                    "content": "This  is analogous to -hoverlap, but pamundice clips the bottom edge of each image be‐\nfore joining it to the one below.\n\n"
                },
                {
                    "name": "-listfile=_",
                    "content": "This option names a file that contains the names of all the input files.  This  is  an\nalternative to specifying a file name pattern as an argument.\n\nThe named file contains file name, one per line.  Each file contains the\nimage for one tile, in row-major order, top to bottom, left to right.  So\nthe first file is the upper left tile, the second is the one to right of\nthat, etc.  The number of lines in the file must be equal to the number of\ntiles in the output, the product of the -across and -down\nvalues.\n\nThe file names have no meaning to pamundice.  You can use the same\nfile multiple times to have identical tiles in the output.\n\nThis option was new in Netpbm 10.90 (March 2020).\n\n"
                },
                {
                    "name": "-verbose",
                    "content": "Print information about the processing to Standard Error.\n\n\n\n"
                }
            ]
        },
        "HISTORY": {
            "content": "pamundice was new in Netpbm 10.39 (June 2007).  Before that, pamcat is the best substitute.\n\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamdice(1), pamcat(1), pnmindex(1), pnmtile(1), pnm(1) pam(1)\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/pamundice.html\n\nnetpbm documentation                        26 April 2020                   Pamundice User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pamundice - combine grid of images (tiles) into one",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This is the number of tiles across in the grid, i.e. the number of tiles in each rank, or the number of files. Default is 1."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This is the number of tiles up and down in the grid, i.e. the number of tiles in each file, or the number of ranks. Default is 1."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This is the amount in pixels to overlap the tiles horizontally. pamundice clips this much off the right edge of every tile before joining it to the adjacent image to the right. The tiles along the right edge remain whole. There must not be any input image narrower than this. Note that this undoes the effect of the same -hoverlap option of pamdice. Default is zero -- no overlap."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This is analogous to -hoverlap, but pamundice clips the bottom edge of each image be‐ fore joining it to the one below."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option names a file that contains the names of all the input files. This is an alternative to specifying a file name pattern as an argument. The named file contains file name, one per line. Each file contains the image for one tile, in row-major order, top to bottom, left to right. So the first file is the upper left tile, the second is the one to right of that, etc. The number of lines in the file must be equal to the number of tiles in the output, the product of the -across and -down values. The file names have no meaning to pamundice. You can use the same file multiple times to have identical tiles in the output. This option was new in Netpbm 10.90 (March 2020)."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print information about the processing to Standard Error."
        }
    ],
    "examples": [
        "$ pamdice myimage.ppm -outstem=myimagepart -width=10 -height=8",
        "$ pamundice myimagepart%1d%1a.ppm -across=10 -down=8 >myimage.ppm",
        "$ pamundice myimage.ppm myimagepart%2a -across=13 -hoverlap=9"
    ],
    "see_also": [
        {
            "name": "pamdice",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamdice/1/json"
        },
        {
            "name": "pamcat",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamcat/1/json"
        },
        {
            "name": "pnmindex",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmindex/1/json"
        },
        {
            "name": "pnmtile",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmtile/1/json"
        },
        {
            "name": "pnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
        },
        {
            "name": "pam",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pam/1/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Combine a grid of Netpbm images into one.",
        "examples": [
            {
                "description": "Combine the images whose names match the `printf`-style filename expression. Assume a grid with a specific size",
                "command": "pamundice {{filename_%1d_%1a.ppm}} {{-a|-across}} {{grid_width}} {{-d|-down}} {{grid_height}} > {{path/to/output.ppm}}"
            },
            {
                "description": "Assume that the tiles overlap horizontally and vertically by the specified amount",
                "command": "pamundice {{filename_%1d_%1a.ppm}} {{-a|-across}} {{x_value}} {{-d|-down}} {{y_value}} {{-ho|-hoverlap}} {{value}} {{-vo|-voverlap}} {{value}} > {{path/to/output.ppm}}"
            },
            {
                "description": "Specify the images to be combined through a text file containing one filename per line",
                "command": "pamundice {{-l|-listfile}} {{path/to/file.txt}} {{-a|-across}} {{x_value}} {{-d|-down}} {{y_value}} > {{path/to/output.ppm}}"
            }
        ]
    }
}