Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/doc/netpbm/ms/pamgauss.ms

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TL
Pamgauss User Manual
.SH 1
pamgauss
.LP
Updated: 8 May 2004
.br
Table Of Contents
.SH 2
NAME
.LP
pamgauss - create a two dimensional gaussian function as a PAM image
.SH 2
SYNOPSIS
.LP
\fBpamgauss\fR
\fIwidth\fR
\fIheight\fR
\fB-sigma=\fR\fInumber\fR
[\fB-maxval=\fR\fInumber\fR]
[\fB-tupletype=\fR\fIstring\fR]
.LP
Minimum unique abbreviation of option 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.
.SH 2
EXAMPLES
.LP
.DS L
     pamgauss 3 3 -sigma=.5 -tupletype=GRAYSCALE | pamtopnm >gauss.pgm
     pnmconvol -nooffset gauss.pgm myimage.ppm >blurred.ppm
.DE
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.LP
\fBpamgauss\fR generates a one-plane PAM image whose samples are a
gaussian function of their distance from the center of the image.  I.e.
the sample value is highest in the center and goes down, in a bell curve
shape, as you move away from the center.
.LP
The values are scaled so that the area under the surface of the
two-dimensional Gaussian function is the maxval of the image.
.LP
You can use this image, converted to PGM, as a convolution kernel
with \fBpnmconvol\fR to blur an image.  (This technique is known as
Gaussian blurring).
\fIwidth\fR and \fIheight\fR are the dimensions of the image that
\fBpamgauss\fR generates.  Mathematically speaking, they are the domain
of the two dimensional gaussian function.
.LP
The sum of all the samples is equal to the image's maxval (within
rounding error).  This is true even if you clip the Gaussian function
by making the image too small.  If you want to be sure you get a whole
Gaussian function, make sure that you choose a sigma and image
dimensions so that if you made it any larger, the sample values at the
edges would be zero.
.LP
The output image is PAM.  To turn it into a PGM that you can use
with \fBpnmconvol\fR, specify \fB-tupletype=GRAYSCALE\fR and pass
the output through \fBpamtopnm\fR.  You must use the \fB-nooffset\fR
option on \fBpnmconvol\fR because zero means zero in the PAM that
\fBpamgauss\fR generates.
.SH 2
DESCRIPTION
.LP
.LP
This program is part of Netpbm.
.RS
.IP "\fB-sigma=\fR\fInumber\fR"
This is the sigma parameter of the Gaussian function (if it were a
Gaussian probability function, this would be its standard deviation).
The higher the number, the more spread out the function is.  Normally,
you want to make this number low enough that the function reaches zero
value before the edge of your image.
.LP
\fInumber\fR is in units of pixels.
.LP
This option is required.  There is no default.
.IP "\fB-maxval=\fR\fInumber\fR"
This is the maxval for the output image.  It defaults to 255.
.IP "\fB-tupletype=\fR\fIstring\fR"
This is the value of the "tuple_type" attribute of the created PAM image.
It can be any string up to 255 characters.  If you don't specify this,
\fBpamgauss\fR generates a PAM with unspecified tuple type.
.RE
.SH 2
SEE ALSO
.LP
\fBpnmconvol\fR,
\fBpamtopnm\fR,
\fBpgmkernel\fR,
\fBpamseq\fR,
\fBpam\fR
.SH 2
HISTORY
.LP
.LP
\fBpamgauss\fR was new in Netpbm 10.23 (July 2004).
.br
\l'5i'
.SH 2
Table Of Contents
.LP
.IP \(bu
NAME
.IP \(bu
SYNOPSIS
.IP \(bu
SYNOPSIS
.IP \(bu
DESCRIPTION
.IP \(bu
SEE ALSO
.IP \(bu
AUTHORS
.LP

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.