.TL Pamfunc User Manual .SH 1 pamfunc .LP Updated: June 2002 .br Table Of Contents .SH 2 NAME .LP pamfunc - Apply simple arithmetic functions to a Netpbm image .SH 2 SYNOPSIS .LP \fBpamfunc\fR { \fB-multiplier=\fR\fIrealnum\fR | \fB-divisor=\fR\fIrealnum\fR | \fB-adder=\fR\fIinteger\fR | \fB-subtractor=\fR\fIinteger\fR | \fB-min=\fR\fIwholenum\fR | \fB-max=\fR\fIwholenum\fR } [\fIfilespec\fR] .LP All options can be abbreviated to their shortest unique prefix. You may use two hyphens instead of one. You may separate an option name and its value with white space instead of an equals sign. .SH 2 DESCRIPTION .LP .LP This program is part of Netpbm. .LP \fBpamfunc\fR reads a Netpbm image as input and produces a Netpbm image as output, with the same format, maxval, and dimensions as the input. \fBpamfunc\fR applies a simple transfer function to each sample in the input to generate the corresponding sample in the output. The options determine what function. .LP \fBpamarith\fR is the same thing, except only for PNM images, for binary functions -- it takes two PNM images as input and applies a specified simple arithmetic function (e.g. addition) on pairs of samples from the two to produce the single output image. .SH 2 OPTIONS .LP .RS .IP "\fB-multiplier=\fIrealnum\fB\fR" .LP This option makes the transfer function that of multiplying by \fIrealnum\fR. \fIrealnum\fR must be nonnegative. If the result is greater than the image maxval, it is clipped to the maxval. .LP Where the input is a PGM or PPM image, this has the effect of dimming or brightening it. For a different kind of brightening, see \fBppmbrighten\fR and \fBppmflash\fR .LP Also, see \fBppmdim\fR, which does the same thing as \fBpamfunc -multiplier\fR on a PPM image with a multiplier between 0 and 1, except it uses integer arithmetic, so it may be faster. .LP And \fBppmfade\fR can generate a whole sequence of images of brightness declining to black or increasing to white, if that's what you want. .IP "\fB-divisor=\fIrealnum\fB\fR" .LP This option makes the transfer function that of dividing by \fIrealnum\fR. \fIrealnum\fR must be nonnegative. If the result is greater than the image maxval, it is clipped to the maxval. .LP This is the same function as you would get with \fB-multiplier\fR, specifying the multiplicative inverse of \fIrealnum\fR. .IP "\fB-adder=\fIinteger\fB\fR" .LP This option makes the transfer function that of adding \fIwholenum\fR. If the result is greater than the image maxval, it is clipped to the maxval. If it is less than zero, it is clipped to zero. .LP Note that in mathematics, this entity is called an "addend," and an "adder" is a snake. We use "adder" because it makes more sense. .IP "\fB-subtractor=\fIinteger\fB\fR" .LP This option makes the transfer function that of subtracting \fIwholenum\fR. If the result is greater than the image maxval, it is clipped to the maxval. If it is less than zero, it is clipped to zero. .LP Note that in mathematics, this entity is called a "subtrahend" rather than a "subtractor." We use "subtractor" because it makes more sense. .LP This is the same function as you would get with \fB-multiplier\fR, specifying the negative of \fIinteger\fR. .IP "\fB-min=\fIwholenum\fB\fR" .LP This option makes the transfer function that of taking the maximum of the argument and \fIwholenum\fR. I.e the minimum value in the output will be \fIwholenum\fR. If \fIwholenum\fR is greater than the maxval, though, every sample in the output will be maxval. .IP "\fB-max=\fIwholenum\fB\fR" .LP This option makes the transfer function that of taking the minimum of the argument and \fIwholenum\fR. I.e the maximum value in the output will be \fIwholenum\fR. If \fIwholenum\fR is greater than the maxval, the function is idempotent -- the output is identical to the input. .RE .SH 2 SEE ALSO .LP \fBppmdim\fR, \fBppmbrighten\fR, \fBpamdepth\fR, \fBpamarith\fR, \fBpamsummcol\fR, \fBpamsumm\fR, \fBppmfade\fR, \fBpam\fR, \fBpnm\fR, .SH 2 HISTORY .LP .LP This program was added to Netpbm in Release 10.3 (June 2002). .br \l'5i' .SH 2 Table Of Contents .LP .IP \(bu NAME .IP \(bu SYNOPSIS .IP \(bu DESCRIPTION .IP \(bu OPTIONS .IP \(bu SEE ALSO .IP \(bu HISTORY .LP