1Pamgauss User Manual(0) Pamgauss User Manual(0)
2
3
4
6 pamgauss - create a two-dimensional Gaussian function as a PAM image
7
8
10 pamgauss width height -sigma=number [-maxval=number] [-tuple‐
11 type=string] [-maximize] [-oversample=number]
12
13 Minimum unique abbreviation of option is acceptable. You may use dou‐
14 ble hyphens instead of single hyphen to denote options. You may use
15 white space in place of the equals sign to separate an option name from
16 its value.
17
18
19
21 pamgauss 7 7 -sigma=.5 -maximize -tupletype=GRAYSCALE | pamtopnm >gauss.pgm
22 pnmconvol -nooffset -normalize gauss.pgm myimage.ppm >blurred.ppm
23
24
26 This program is part of Netpbm(1).
27
28 pamgauss generates a one-plane PAM image whose samples are a Gaussian
29 function of their distance from the center of the image. I.e. the
30 sample value is highest in the center and goes down, in a bell curve
31 shape, as you move away from the center.
32
33 You can use this image as a convolution kernel with pnmconvol to blur
34 an image. (This technique is known as Gaussian blurring).
35
36 width and height are the dimensions of the image that pamgauss gener‐
37 ates. Mathematically speaking, they are the domain of the two-dimen‐
38 sional Gaussian function. If you want to be sure you get a whole
39 Gaussian function, make sure that you choose a standard deviation and
40 image dimensions so that if you made it any larger, the sample values
41 at the edges would be zero.
42
43 The output image is PAM. To make it usable with pnmconvol, specify
44 -tupletype=GRAYSCALE so pnmconvol can use it as if it were PGM. You
45 must use the -nooffset option on pnmconvol because zero means zero in
46 the PAM that pamgauss generates.
47
48 Without -maximize, the sum of all the samples is equal to the image's
49 maxval (within rounding error). This is true even if you clip the
50 Gaussian function by making the image too small. This is what is nor‐
51 mally required of a convolution kernel.
52
53 pamgauss oversamples and averages to represent the continuous Gaussian
54 function in discrete samples in the PAM output. Consider an image 11
55 samples wide and an oversampling factor of 10. The samples can be
56 thought of as contiguous squares one unit wide. The center of the
57 image is thus the center of the 6th sample from the left. The 3rd sam‐
58 ple from the left covers a range of distances from 3 to 4 units from
59 the center of the image. Because the oversampling factor is 10, pam‐
60 gauss computes the value of the Gaussian function at 10 points evenly
61 spaced between 3 and 4 units from the center of the image and assigns
62 the 3rd sample from the left the mean of those 10 values.
63
64
65
67 In addition to the options common to all programs based on libnetpbm
68 (most notably -quiet, see
69 Common Options ⟨index.html#commonoptions⟩ ), pamgauss recognizes the
70 following command line options:
71
72
73
74 -sigma=number
75 This is the standard deviation of the Gaussian function. The
76 higher the number, the more spread out the function is. Nor‐
77 mally, you want to make this number low enough that the function
78 reaches zero value before the edge of your image.
79
80 number is in units of samples.
81
82 This option is required. There is no default.
83
84
85 -maximize
86 Causes pamgauss to use the whole dynamic range available in the
87 output PAM image by choosing an amplitude for the Gaussian func‐
88 tion that causes the maximum value in the image to be the maxval
89 of the image.
90
91 If you select this, you probably want to normalize the output
92 (scale the samples down so the volume under the surface of the
93 two-dimensional Gaussian function is the maxval) before you use
94 it, for example with pnmconvol's -normalize option. The reason
95 this is different from just not using -maximize is that this
96 subsequent normalization can be done with much more precision
97 than can be represented in a PAM image.
98
99 Without this option, pamgauss uses an amplitude that makes the
100 volume under the surface of the two-dimensional Gaussian func‐
101 tion the maxval of the image. This means all the samples in the
102 image are normally considerably less than the maxval.
103
104 This option was new in Netpbm 10.79 (June 2017).
105
106
107 -maxval=number
108 This is the maxval for the output image. 65535 is almost always
109 the best value to use. But there may be some programs (not part
110 of Netpbm) that can't handle a maxval greater than 255.
111
112 The default is 255.
113
114
115 -tupletype=string
116 This is the value of the "tuple_type" attribute of the created
117 PAM image. It can be any string up to 255 characters.
118
119 If you don't specify this, pamgauss generates a PAM with unspec‐
120 ified tuple type.
121
122
123 -oversample=number
124 This sets the oversampling factor. pamgauss samples the Gauss‐
125 ian function this many times, both horizontally and vertically,
126 to get the value of each sample in the output.
127
128 An oversampling factor of 1 means no oversampling, which means
129 each sample is based only on the value of the Gaussian function
130 at the center of the sample.
131
132 The default is 5 divided by the standard deviation, rounded up
133 to a whole number.
134
135 This option was new in Netpbm 10.79 (June 2017). Before that,
136 it is essentially 1 - there is no oversampling.
137
138
139
140
142 pnmconvol(1), pamtopnm(1), pgmkernel(1), pamseq(1), pam(1)
143
144
146 pamgauss was new in Netpbm 10.23 (July 2004).
147
149 This manual page was generated by the Netpbm tool 'makeman' from HTML
150 source. The master documentation is at
151
152 http://netpbm.sourceforge.net/doc/pamgauss.html
153
154netpbm documentation 18 May 2017 Pamgauss User Manual(0)