1Pamgauss User Manual(0)                                Pamgauss User Manual(0)
2
3
4

NAME

6       pamgauss - create a two-dimensional Gaussian function as a PAM image
7
8

SYNOPSIS

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

EXAMPLES

21            pamgauss 7 7 -sigma=.5 -maximize -tupletype=GRAYSCALE | pamtopnm >gauss.pgm
22            pnmconvol -nooffset -normalize gauss.pgm myimage.ppm >blurred.ppm
23
24
25

DESCRIPTION

27       This program is part of Netpbm(1).
28
29       pamgauss  generates  a one-plane PAM image whose samples are a Gaussian
30       function of their distance from the center of  the  image.   I.e.   the
31       sample  value  is  highest in the center and goes down, in a bell curve
32       shape, as you move away from the center.
33
34       You can use this image as a convolution kernel with pnmconvol  to  blur
35       an image.  (This technique is known as Gaussian blurring).
36
37       width  and  height are the dimensions of the image that pamgauss gener‐
38       ates.  Mathematically speaking, they are the domain of  the  two-dimen‐
39       sional  Gaussian  function.   If  you  want  to be sure you get a whole
40       Gaussian function, make sure that you choose a standard  deviation  and
41       image  dimensions  so that if you made it any larger, the sample values
42       at the edges would be zero.
43
44       The output image is PAM.  To make it  usable  with  pnmconvol,  specify
45       -tupletype=GRAYSCALE  so  pnmconvol  can use it as if it were PGM.  You
46       must use the -nooffset option on pnmconvol because zero means  zero  in
47       the PAM that pamgauss generates.
48
49       Without  -maximize,  the sum of all the samples is equal to the image's
50       maxval (within rounding error).  This is true  even  if  you  clip  the
51       Gaussian  function by making the image too small.  This is what is nor‐
52       mally required of a convolution kernel.
53
54       pamgauss oversamples and averages to represent the continuous  Gaussian
55       function  in  discrete samples in the PAM output.  Consider an image 11
56       samples wide and an oversampling factor of  10.   The  samples  can  be
57       thought  of as contiguous squares one unit wide.  The center of the im‐
58       age is thus the center of the 6th sample from the left.  The 3rd sample
59       from  the  left  covers a range of distances from 3 to 4 units from the
60       center of the image.  Because the oversampling factor is  10,  pamgauss
61       computes  the value of the Gaussian function at 10 points evenly spaced
62       between 3 and 4 units from the center of the image and assigns the  3rd
63       sample from the left the mean of those 10 values.
64
65
66

OPTIONS

68       In  addition  to  the options common to all programs based on libnetpbm
69       (most notably -quiet, see
70        Common Options ⟨index.html#commonoptions⟩ ), pamgauss  recognizes  the
71       following command line options:
72
73
74
75       -sigma=number
76              This  is  the  standard deviation of the Gaussian function.  The
77              higher the number, the more spread out the  function  is.   Nor‐
78              mally, you want to make this number low enough that the function
79              reaches zero value before the edge of your image.
80
81              number is in units of samples.
82
83              This option is required.  There is no default.
84
85
86       -maximize
87              Causes pamgauss to use the whole dynamic range available in  the
88              output PAM image by choosing an amplitude for the Gaussian func‐
89              tion that causes the maximum value in the image to be the maxval
90              of the image.
91
92              If  you  select  this, you probably want to normalize the output
93              (scale the samples down so the volume under the surface  of  the
94              two-dimensional  Gaussian function is the maxval) before you use
95              it, for example with pnmconvol's -normalize option.  The  reason
96              this  is  different  from  just not using -maximize is that this
97              subsequent normalization can be done with  much  more  precision
98              than can be represented in a PAM image.
99
100              Without  this  option, pamgauss uses an amplitude that makes the
101              volume under the surface of the two-dimensional  Gaussian  func‐
102              tion the maxval of the image.  This means all the samples in the
103              image are normally considerably less than the maxval.
104
105              This option was new in Netpbm 10.79 (June 2017).
106
107
108       -maxval=number
109              This is the maxval for the output image.  65535 is almost always
110              the best value to use.  But there may be some programs (not part
111              of Netpbm) that can't handle a maxval greater than 255.
112
113              The default is 255.
114
115
116       -tupletype=string
117              This is the value of the "tuple_type" attribute of  the  created
118              PAM image.  It can be any string up to 255 characters.
119
120              If you don't specify this, pamgauss generates a PAM with unspec‐
121              ified tuple type.
122
123
124       -oversample=number
125              This sets the oversampling factor.  pamgauss samples the  Gauss‐
126              ian  function this many times, both horizontally and vertically,
127              to get the value of each sample in the output.
128
129              An oversampling factor of 1 means no oversampling,  which  means
130              each  sample is based only on the value of the Gaussian function
131              at the center of the sample.
132
133              The default is 5 divided by the standard deviation,  rounded  up
134              to a whole number.
135
136              This  option  was new in Netpbm 10.79 (June 2017).  Before that,
137              it is essentially 1 - there is no oversampling.
138
139
140
141

SEE ALSO

143       pnmconvol(1), pamtopnm(1), pgmkernel(1), pamseq(1), pam(1)
144
145

HISTORY

147       pamgauss was new in Netpbm 10.23 (July 2004).
148

DOCUMENT SOURCE

150       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
151       source.  The master documentation is at
152
153              http://netpbm.sourceforge.net/doc/pamgauss.html
154
155netpbm documentation              18 May 2017          Pamgauss User Manual(0)
Impressum