summary refs log tree commit diff
path: root/pamstack.html
blob: cbfd311ad8fcdd40834d3eb58ad8929102ca6189 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamstack User Manual</title></head>
<body>
<h1>pamstack</h1>
Updated: 18 May 2023
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>
pamstack - stack planes of multiple PAM images into one PAM image

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

<b>pamstack</b>
[<b>-tupletype </b><i>tupletype</i>]
[<b>-firstmaxval</b>,<b>-lcmmaxval</b>]
[<i>inputfilespec</i> ...]

<p>All options may be abbreviated to the shortest unique prefix.  You
may use two hyphens instead of one.  You may separate an option from
its value with a space instead of <b>=</b>.

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

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

<p><b>pamstack</b> reads multiple PAM or PNM images as input and
produces a PAM image as output, consisting of all the planes
(channels) of the inputs, stacked in the order specified.

<p>It can also just change the tuple type of a single PAM image.
  
<p>For any one (but not more) of the input files, you may specify "-" to mean
Standard Input.  If you specify no arguments at all, the input is one file:
Standard Input.

<p>The output is the same dimensions as the inputs, except that the depth is
  the sum of the depths of the inputs.  The maxval is the same as the inputs
  if they are all alike, and controlled by <b>-firstmaxval</b>
  and <b>-lcmmaxval</b> if not.  The tuple type is a null string unless you
  specify the <b>-tupletype</b> option.
  
<p> <b>pamstack</b> fails if the inputs are not all the same width and height.
It also fails if they do not all have the same maxval, unless you specify
<b>-firstmaxval</b> or <b>-lcmmaxval</b>.

<p><b>pamstack</b> works with multi-image streams.  It stacks the 1st
image in all the streams into one output image (the first one in the
output stream), then stacks the 2nd image in all the streams into the
2nd image in the output stream, and so on, until one of the streams
runs dry.  It's like a matrix operation.

<p>Before Netpbm 10.32 (February 2006), <b>pamstack</b> ignored all but
the first image in each input stream.

<p><b>pamchannel</b> does the opposite of <b>pamstack</b>:  It extracts
individual planes from a single PAM.

<p>Use <a href="pamtopnm.html">pamtopnm</a> to convert a suitable PAM
image to a more traditional PNM (PBM, PGM, or PPM) image.  (But there's
no need to do that if you're going to feed it to a modern Netpbm program --
they all take suitable PAM input directly).

<p>One example of using <b>pamstack</b> is that some Netpbm programs
accept as input a PAM that represents graphic image with transparency
information.  Taking a color image for example, this would be a PAM
with tuple type "RGB_ALPHA".  In Netpbm, such images were
traditionally represented as two images - a PPM for the color and a
PGM for the transparency.  To convert a PPM/PGM pair into
PAM(RGB_ALPHA) input that newer programs require, do something like
this:

<pre>
<kbd>
$ pamstack -tupletype=RGB_ALPHA myimage.ppm myalpha.pgm | \
      pamtouil &gt;myimage.uil
</kbd>
</pre>

<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>pamstack</b> recognizes the following
command line option:

<dl compact>

<dt><b>-tupletype </b><i>tupletype</i>
<dd>
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.

<dt><b>-firstmaxval</b>
<dd>
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.

<p>By default, <b>pamstack</b> requires all the input images to have the same
maxval.  If they don&apos;t, it fails.
    
<p>You cannot specify this with <b>-lcmmaxval</b>.

<p>This option was new in Netpbm 11.03 (June 2023).
  
<dt><b>-lcmmaxval</b>
<dd>
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.

<p>By default, <b>pamstack</b> requires all the input images to have the same
maxval.  If they don&apos;t, it fails.
    
<p>You cannot specify this with <b>-firstmaxval</b>.

<p>This option was new in Netpbm 11.03 (June 2023).

</dl>

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

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

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

<p><b>pamstack</b> was new in Netpbm 10.0 (June 2002).

<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="#seealso">SEE ALSO</a>
<li><a href="#history">HISTORY</a>
</ul>
</body>
</html>