summary refs log tree commit diff
path: root/pamseq.html
blob: f46948aaa82fdb9049137a172a72c54e2cbac120 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamseq User Manual</title></head>
<body>
<h1>pamseq</h1>
<br>
Updated: 30 April 2022
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pamseq - generate PAM image of a numerical sequence of tuple values

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

<b>pamseq</b>
[<b>-tupletype=</b><i>tupletype</i>]
<i>depth</i>
<i>maxval</i>
[<b>-min=</b><i>n</i><b>,</b><i>n</i><b>,</b>...]
[<b>-max=</b><i>n</i><b>,</b><i>n</i><b>,</b>...]
[<b>-step=</b><i>n</i><b>,</b><i>n</i><b>,</b>...]

<p>All options can be abbreviated to their shortest unique prefix.  You
may use two hyphens instead of one to designate an option.  You may
use either white space or an equals sign between an option name and its
value.

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

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

<p><b>pamseq</b> generates a PAM image of a specified depth and specified
  maxval that consists of a single row.  The row consists of tuples
  containing sample values in a numerical sequence.

<p>For example

<pre>
<kbd>
    pamseq 1 4
</kbd>
</pre>

  generates a 5 pixel wide image of 1 row with depth 1 tuples containing these
  samples, in order from left to right:

<pre>
    0 1 2 3 4
</pre>

  The following example uses depth 2:

<pre>
<kbd>
    pamseq 2 2
</kbd>
</pre>

  The resulting image is a 9 pixel wide image of 1 row with depth 2 containing
  these samples, in order from left to right;

<pre>
    (0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (2,0) (2,1) 2,2)
</pre>

<p>
  You can choose the starting and ending sample values and the step for each
  plane:  Here is an example of that:

<pre>
<kbd>
    pamseq 1 255 -min=4 -max=8 -step=2
</kbd>
</pre>

This generates

<pre>
    4 6 8
</pre>

In two dimensions:

<pre>
<kbd>
    pamseq 2 255 -min=0,4 -max=2,8 -step=1,2
</kbd>
</pre>

<pre>
    (0,4) (0,6) (0,8) (1,4) (1,6) (1,8) (2,4) (2,6) (2,8)
</pre>


<p>
  <b>pamseq</b> varies first the highest numbered plane, then the next lower
  numbered plane, etc.  Within each plane, the program varies from low sample
  value to high.

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

<dl compact>
<dt><b>-tupletype</b>
<dd>
This is the value of the "tuple_type" attribute of the created PAM image.
It can be any string up to 255 characters.

<dt><b>-min=</b><i>n</i><b>,</b><i>n</i><b>,</b>...
<dd>
  This gives the starting value for the sequence in each plane.  The number
  of comma-separated numbers must be equal to the number of planes in the
  image (its depth).  Each number must be a whole number no greater than
  the maxval of the image.  The first number is for Plane 0, the second for
  Plane 1, etc.

  <p>The default is 0 in every plane.

  <p>This option was new in Netpbm 10.99 (June 2022).

<dt><b>-max=</b><i>n</i><b>,</b><i>n</i><b>,</b>...
  <p>This is analogous to <b>-min</b>, giving the ending value for the
    sequence.

  <p>Each value must be at least as great as the corresponding <b>-min</b>
    value.

    <p>The default is the maxval in every plane.
    
  <p>This option was new in Netpbm 10.99 (June 2022).

<dt><b>-step=</b><i>n</i><b>,</b><i>n</i><b>,</b>...
  <p>This is analogous to <b>-min</b>, giving the step value for the
    sequence (difference between two consecutive numbers).

    <p>Each value must be positive and no greater than the maxval.

    <p>The default is 1.
    
  <p>This option was new in Netpbm 10.99 (June 2022).

</dl>

<h2 id="usage">USAGE</h2>

<p>To create a simple ramp of the values 0..255, for input to various matrix
calculations, try
<pre>
<kbd>
  pamseq 1 255 
</kbd>
</pre>
(Before <b>pamseq</b> existed, <b>pgmramp</b> was often pressed into service
for this).

<p>To create a PPM color map of all the possible colors representable with a
maxval of 5, do
<pre>
<kbd>
  pamseq 3 5 -tupletype=RGB | pamtopnm
</kbd>
</pre>

Again, with a modern program based on the Netpbm library, you don't need
the <b>pamtopnm</b> because a PAM RGB image is equivalent to a PPM image.

<p>You can use such a color map with <b><a
href="pnmremap.html">pnmremap</a></b> to quantize the colors in an
image.  With the maxval of 5 given in the example, you get a color map
of the set of "web safe" colors as defined by Netscape.  Most web
browsers guarantee that they can produce at least these 216 colors
(215 plus black).

<p><b>pamrestack</b> can often produce a useful two-dimensional image from
<b>pamseq</b>'s single row.

<pre>
<kbd>
    pamseq 2 255 -min=0,4 -max=2,8 -step=1,2 | pamrestack -width=3
</kbd>
</pre>

<pre>
    (0,4) (0,6) (0,8)
    (1,4) (1,6) (1,8)
    (2,4) (2,6) (2,8)
</pre>
  

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

<b><a href="pnmremap.html">pnmremap</a></b>,
<b><a href="pamtopnm.html">pamtopnm</a></b>,
<b><a href="pamrestack.html">pamrestack</a></b>,
<b><a href="pam.html">pam</a></b>

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

<b>pamseq</b> was added to Netpbm in 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="#usage">USAGE</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#history">HISTORY</a>
</ul>
</body>
</html>