summary refs log tree commit diff
path: root/pamcat.html
blob: 3338c4720755d9d67998b2ae8fc1c97596d9d102 (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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamcat User Manual</title></head>
<body>
<h1>pamcat</h1>
Updated: 30 July 2022
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pamcat - concatenate Netpbm images

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

<b>pamcat</b>

{<b>-leftright</b> | <b>-lr</b> | <b>-topbottom</b> | <b>-tb</b>}

[<b>-white</b>|<b>-black</b>]

[<b>-jtop</b>|<b>-jbottom</b>|<b>-jcenter</b>]
[<b>-jleft</b>|<b>-jright</b>|<b>-jcenter</b>]

<i>netpbmfile</i> ...


<p>Minimum unique abbreviation of option is acceptable.  You may use
double hyphens instead of single hyphen to denote options.  You may
use white space in place of the equals sign to separate an option name
from its value.

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

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

<p><b>pamcat</b> reads one or more Netpbm images as input, concatenates them
either left to right or top to bottom, and produces a single Netpbm image as
output.

<p>Options <b>-leftright</b> and <b>-topbottom</b> determine the direction
  of the concatenation.
  
<p>The images do not have to be the same shape:  You can concatenate images
  of different widths top to bottom and of different heights left to right.
  You can concatenate images of different depths (numbers of planes).  You
  can concatenate a PBM image with a PPM image.  Et cetera.

<p>The format of the output image is the highest of the formats of the
  input images, in the order PBM, PGM, PPM, PAM.

<p>For PAM output, if all of the input images has the same tuple type
  (including implied tuple types of PNM images), that is the tuple type of the
  output.  If the inputs differ, but are all visual tuple types, the
  output&apos;s tuple type is the most primitive that can represent all the
  input.  E.g. if inputs are GRAYSCALE and RGB, the output is RGB, and if the
  inputs are GRAYSCALE_ALPHA and RGB, the output is RGB_ALPHA.  If the inputs
  differ and are not all visual, the output tuple type is a null string.

<p>When the output is PAM, its depth is the maximum of the depths of the
  inputs (including implied depths of PNM images), but at least enough to
  represent the tuple type specified above.  In the case of nonvisual PAM
  output, input images are padded to this output depth with higher numbered
  planes of all zeroes.

<p>Where the input images are of different widths and you concatenate top
  to bottom, <b>pamcat</b> generates output as wide as the widest of the
  inputs and pads the narrower ones.  The images can be justified either
  left, right, or center within this padded field.  Use options
  <b>-jleft</b>, <b>-jright</b>, and <b>-jcenter</b> to control this.

<p>Similarly, where the input images are of different heights and you
  concatenate left to right, <b>pamcat</b> generates output as tall as the
  tallest of the inputs and pads the shorter ones.  The images can be
  justified either top, bottom, or center within this padded field.  Use
  options
  <b>-jtop</b>, <b>-jbottom</b>, and <b>-jcenter</b> to control this.

<p>You can make the padding black or white or let <b>pamcat</b> determine a
  likely background color, with possibly different colored padding for each
  input image.  Control this with the <b>-black</b> and <b>-white</b> options.

<p>Where the output image contains transparency information (because at least
  one of the input images does), the padding is opaque.  (That is consistent
  with the result for an output image without transparency information, because
  such an image is defined to be opaque).
  
<p>The arguments are names of input files.  Any one of these, but not more
than one, may be "-" to indicate Standard Input.  If you have no
arguments, that means a single input image from Standard Input (and that is
pointless - the output is the same as the input).

<p>To assemble a regular grid of images, you can use <b>pamundice</b>.

<p>To do the reverse, you might use <b>pamdice</b> to split an image
up into smaller ones of equal size or <b>pamcut</b> to chop off part
of an image or extract part of an image.

<p><b>pnmtile</b> concatenates a single input image to itself repeatedly.


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

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>pamcat</b> recognizes the following
command line options:

<h3 id="direction">Direction</h3>

<dl compact>
<dt><b>-topbottom</b>, <b>-tb</b>
<dd>Combine images vertically, top to bottom.

<dt><b>-leftright</b>, <b>-lr</b>
<dd>Combine images horizontally, left to right.

  <p>You must specify the direction by specifying one of the above.  You cannot
    specify both.

</dl>

<h3 id="justification">Justification</h3>

<dl compact>
  <dt><b>-jleft</b>
  <dd>Left-justify images in a top-bottom concatenation.
    <p>You cannot specify this with <b>-jright</b>
    <p>This option is invalid in a left-right concatenation.

  <dt><b>-jright</b>
  <dd>Right-justify images in a top-bottom concatenation.
    <p>You cannot specify this with <b>-jleft</b>
    <p>This option is invalid in a left-right concatenation.

  <dt><b>-jtop</b>
  <dd>Top-justify images in a left-right concatenation.
    <p>You cannot specify this with <b>-jbottom</b>
    <p>This option is invalid in a top-bottom concatenation.

  <dt><b>-jbottom</b>
  <dd>Bottom-justify images in a left-right concatenation.
    <p>You cannot specify this with <b>-jtop</b>
    <p>This option is invalid in a top-bottom concatenation.

  <dt><b>-jcenter</b>
  <dd>Center images (valid for both left-right and top-bottom concatenations).
    This is the default.
    
</dl>

<p>By default, <b>pamcat</b> centers the smaller images.
  <b>-topbottom -jleft</b> would stack the images on top of each other, flush
  with the left edge.  <b>-leftright -jbottom</b> would line up the images
  left to right with their bottom edges aligned as if sitting on a table.


<h3 id="paddingcolor">Padding Color</h3>

<dl compact>

<dd>These options specify what color to use to fill in the extra space when
doing the justification.  If neither is specified, <b>pamcat</b> chooses
whichever color seems to be right for the images, and the color may be
different for each image.

<dt><b>-white</b>
<dd>Make all padding white.
  <p>You may not specify this with <b>-black</b>
<dt><b>-black</b>
<dd>Make all padding black.
  <p>You may not specify this with <b>-white</b>

</dl>


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

<b><a href="pamundice.html">pamundice</a></b>,

<b><a href="pamdice.html">pamdice</a></b>,

<b><a href="pnmtile.html">pnmtile</a></b>,

<b><a href="pamcut.html">pamcut</a></b>,

<b><a href="pnm.html">pnm</a></b>,

<b><a href="pam.html">pam</a></b>


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

<p><b>pamcat</b> was new in Netpbm 11.00 (September 2022); in earlier versions,
  <b>pnmcat</b> does most of the same thing.

<p>Primordial Netpbm/Pbmplus contained concatenation tools, but there were two
  of them: <b>pbmcatlr</b> for left-right concatenation of PBM images
  and <b>pbmcattb</b> for top-bottom concatenation.  When the PGM and PPM
  formats were added, these programs were combined and extended to handle all
  three formats, as <b>pnmcat</b>.  All of this work was done by Pbmplus
  author Jef Poskanzer.

<p>In Netpbm 10.44 (September 2008), Akira F Urushibata added special fast
  processing for raw PBM images, exploiting bitstring processing CPU
  facilities.

<p><b>pnmcat</b> was one of the most essential programs in Netpbm, but one
  thing it could not concatenate was PAM images with transparency.  So in
  Netpbm 11.00 (September 2022), Bryan Henderson wrote <b>pamcat</b> to
  replace it.  It reused the raw PBM fast path code from <b>pnmcat</b> almost
  verbatim.

<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>
  <ul>
  <li><a href="#direction">Direction</a>
  <li><a href="#justification">Justification</a>
  <li><a href="#paddingcolor">Padding Color</a>
  </ul>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#history">HISTORY</a>
</ul>
</body>
</html>