Linux Commands Examples

A great documentation place for Linux commands


create a montage of portable anymaps

see also : pnmcat - pnmindex


pnmmontage [-?|-help] [-header=headerfile] [-quality=n] [-prefix=prefix] [-0|-1|-2|...|-9] pnmfile...

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


no example yet ...

... Feel free to add your own example above to help other Linux-lovers !


Packs images of differing sizes into a minimum-area composite image, optionally producing a C header file with the locations of the subimages within the composite image.


-?, -help

Displays a (very) short usage message.


Tells pnmmontage to write a C header file of the locations of the original images within the packed image. Each original image generates four #defines within the packed file: xxxX, xxxY, xxxSZX, and xxxSZY, where xxx is the name of the file, converted to all uppercase. The #defines OVERALLX and OVERALLY are also produced, specifying the total size of the montage image.


Tells pnmmontage to use the specified prefix on all of the #defines it generates.


Before attempting to place the subimages, pnmmontage will calculate a minimum possible area for the montage; this is either the total of the areas of all the subimages, or the width of the widest subimage times the height of the tallest subimage, whichever is greater. pnmmontage then initiates a problem-space search to find the best packing; if it finds a solution that is (at least) as good as the minimum area times the quality as a percent, it will break out of the search. Thus, -q 100 will find the best possible solution; however, it may take a very long time to do so. The default is -q 200.

-0, -1, ... -9

These options control the quality at a higher level than -q; -0 is the worst quality (literally pick the first solution found), while -9 is the best quality (perform an exhaustive search of problem space for the absolute best packing). The higher the number, the slower the computation. The default is -5.


Using -9 is excessively slow on all but the smallest image sets. If the anymaps differ in maxvals, then pnmmontage will pick the smallest maxval which is evenly divisible by each of the maxvals of the original images.

see also

pnmcat , pnmindex , pnm, pam, pbm, pgm, ppm


Copyright (C) 2000 by Ben Olmstead.

How can this site be more helpful to YOU ?

give  feedback