about summary refs log tree commit diff
path: root/pnmmontage.html
blob: 29b3d6ac7d13af9a83ee91330e84d8f2240e0ae4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Pnmmontage User Manual</TITLE></HEAD>
<BODY>
<H1>pnmmontage</H1>
Updated: 22 November 2012
<BR>
<A HREF="#index">Table Of Contents</A>

<H2>NAME</H2>

pnmmontage - create a montage of PNM images

<H2 id="synopsis">SYNOPSIS</H2>

<B>pnmmontage</B>

[<B>-header=</B><I>headerfile</I>]

[<B>-quality=</B><I>n</I>]

[<B>-prefix=</B><I>prefix</I>]

[<B>-0</B>|<B>-1</B>|<B>-2</B>|<B>...</B>|<B>-9</B>]

[<b>-data=</b><i>filename</i>]

<i>pnmfile</I>...

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pnmmontage</b> packs images of differing sizes into a minimum-area
composite image.

<p>Areas of the output that cannot be occupied by an image are black.


<H2 id="options">OPTIONS</H2>

<DL COMPACT>

<DT><b>-data=</b><i>filename</i>

<dd>This option causes <b>pnmmontage</b> to write a file that describes
in machine-readable form the positions of the original images within
the packed image.  Here is an example:

<pre>
<tt>
            :0:0:227:298
            ../image1.ppm:0:0:227:149
            ../image2.ppm:0:149:227:149
</tt>
</pre>


<p>There is a line for each component image and one for the composite.

<p>The 5 fields on each line are:

<ol>
<li>source image name (or null string indicating the line for the composite
image)
<li>Column number of upper left corner of the image
<li>Row number of upper left corner of the image
<li>width of the image (columns)
<li>height of the image (rows)
</ol>

<p>This option was new in Netpbm 10.6 (July 2002).

<DT><B>-header=</B><i>filename</i>

<DD>Tells <B>pnmmontage</B> 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 output also includes #defines OVERALLX and OVERALLY, which
specifies the total size of the montage image.

<p>Here is an example:

<pre>
<tt>
            #define OVERALLX 227
            #define OVERALLY 298
            
            #define X 0
            #define Y 0
            #define SZX 227
            #define SZY 149
            
            #define X 0
            #define Y 149
            #define SZX 227
            #define SZY 149
</tt>
</pre>

<DT><B>-prefix</B>

<DD>Tells <B>pnmmontage</B> to use the specified prefix on all of the
#defines it generates.

<DT><B>-quality</B>

<DD>Before attempting to place the subimages, <B>pnmmontage</B> 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.  <B>pnmmontage</B> 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, <B>-quality=100</B> will find the best possible
solution; however, it may take a very long time to do so.  The default
is <B>-quality=200.</B>

<DT><B>-0</b>, <b>-1</b>, ... <b>-9</B>

<DD>These options control the quality at a higher level than
<B>-quality</B>; <B>-0</B> is the worst quality (pick the first
solution found), while <B>-9</B> 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
<B>-5</B>.

</DL>


<H2 id="notes">NOTES</H2>

<p>Using <B>-9</B> is very slow on all but the smallest image sets.

<p>The minimum area arrangement is often not a convenient shape.  For
example, it might be a tall, thin column of images, when you'd rather
have something more square.  To force a minimum width or height, you
can include a strut image - a black image that wide and one pixel high.
Similarly, you can use a vertical strut to force a minimum height.


<H2 id="seealso">SEE ALSO</H2>

<B><A HREF="pnmcat.html">pnmcat</A></B>,

<B><A HREF="pnmindex.html">pnmindex</A></B>,

<B><A HREF="pnm.html">pnm</A></B>,

<B><A HREF="pam.html">pam</A></B>,

<B><A HREF="pbm.html">pbm</A></B>,

<B><A HREF="pgm.html">pgm</A></B>,

<B><A HREF="ppm.html">ppm</A></B>

<H2 id="history">HISTORY</H2>

<p><b>pnmmontage</b> was new in Netpbm 9.10 (January 2001).


<H2 id="author">AUTHOR</H2>

Copyright (C) 2000 by Ben Olmstead.

<HR>
<H2 id="index">Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#options">OPTIONS</A>
<LI><A HREF="#notes">NOTES</A>
<LI><A HREF="#seealso">SEE ALSO</A>
<LI><A HREF="#history">HISTORY</A>
<LI><A HREF="#author">AUTHOR</A>
</UL>
</BODY>
</HTML>