summary refs log tree commit diff
path: root/pnmsmooth.html
blob: 76c2c2a7f535303029c7686c7e177658d9dd4493 (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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pnmsmooth User Manual</title></head>
<body>
<h1>pnmsmooth</h1>
Updated: 19 December 2009
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>
pnmsmooth - smooth out an image

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

<b>pnmsmooth</b>
[<b>-width=</b><i>cols</i>] [<b>-height=</b><i>rows</i>]
[<i>pnmfile</i>] [<b>-size</b>]

<p>Minimum unique abbreviations of options 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>pnmsmooth</b> smoothes out an image by replacing each pixel with the
average of its width X height neighbors.  It is implemented as a program that
invokes <b>pnmconvol</b> with an appropriate convolution matrix.

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

<dl compact>
<dt><b>-width=</b><i>cols</i>
<dt><b>-height=</b><i>rows</i>

<dd>
These options specify the dimensions of the convolution matrix.
Default dimensions are 3 wide and 3 high.

<p>Before Netpbm 10.49 (December 2009), the maximum size of the convolution
matrix is limited by the maxval of the image such that width * height * 2 must
not exceed the maxval.  (use <b>pamdepth</b> to increase the maxval if
necessary).

<p>These options were new in Netpbm 10.32 (February 2006).  Before that,
use <b>-size</b>.

<dt><b>-size</b>

<dd>This deprecated option exists in current Netpbm for backward
compatibility.  It was obsoleted by <b>-width</b> and <b>-height</b>
in Netpbm 10.32 (February 2006).

<p>When you use this option, the first two program arguments are the width
and height, respectively, of the convolution matrix and do the same thing
as the <b>-width</b> and <b>-height</b> option values.  The third
(optional) program argument is the input file name.

<p>In reality, in old <b>pnmsmooth</b>, the width and height are two
values of the <b>-size</b> option, but the modern Netpbm command syntax
paradigm doesn't allow an option with multiple values, so instead
<b>-size</b> is an option with no value and width and height are program
arguments.  That has the fortunate effect of making the following command
mean the same in current <b>pnmsmooth</b> as in old <b>pnmsmooth</b>:
<pre>
<kbd>
     pnmsmooth -size 5 5 infile.ppm &gt;outfile.ppm
</kbd>
</pre>

<dt><b>-dump=</b><i>dumpfile</i>

<dd>This options makes <b>pnmsmooth</b> only show you the
convolution matrix.  It writes to Standard Output a <b>pnmconvol</b>
<b>-matrix</b> option value that represents the matrix.  It does not
invoke <b>pnmconvol</b> and does not produce an output image.

<p>Before Netpbm 10.49 (December 2009), this option is rather different.
It takes a file name as a value, and it writes to that file the
convolution matrix as a PGM file (as used to be the normal input for
<b>pnmconvol</b>).

</dl>



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

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

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

<p>Before Netpbm 10.32 (February 2006), <b>pnmsmooth</b> did not use
the modern Netpbm command line parser, so had an unconventional command line
syntax.  Most importantly, you could not use an equal sign or double
hyphens in the options.

<p>Before Netpbm 10.49 (December 2009), there was a <b>-dump</b> option.
This strange option caused <b>pnmsmooth</b> not to do any smoothing or
produce any output image but instead write the convolution matrix it
would have used, as PGM file such as <b>pnmconvol</b> used to use, to
a file you specify.  The idea was you could then use that file with a
separate invocation of <b>pnmconvol</b>.

<p>Then, in Netpbm 10.49, there was a rather different <b>-dump</b>
option with a similar purpose: It caused <b>pnmsmooth</b> to write to
Standard Error a string suitable as a value for the <b>pnmconvol</b>
<b>-matrix</b> option (an option that was new in Netpbm 10.49).

<p>But in Netpbm 10.51 (June 2010), <b>pnmconvol</b> started using the even
newer <b>pnmconvol</b> <b>-normalize</b> option (new in 10.50), which made
specifying the convolution matrix for the kind of smoothing that
<b>pnmsmooth</b> does trivial, so <b>-dump</b> disappeared from
<b>pnmsmooth</b>.

<p>(There were also ease of implementation issues that kept us from simply
keeping the original <b>-dump</b> around for backward compatibility: As we
modified <b>pnmsmooth</b> to take advantage of the new features of
<b>pnmconvol</b>, which <b>pnmsmooth</b> uses internally, the information
needed to implement <b>-dump</b> was no longer available in the program).

<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>