pamfunc { -multiplier=realnum | -divisor=realnum | -adder=integer |
-subtractor=integer | -min=wholenum | -max=wholenum -andmask=hexmask
-ormask=hexmask -xormask=hexmask -not -shiftleft=count
-shiftright=count } [filespec]

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.

This program is part of Netpbm.

pamfunc reads a Netpbm image as input and produces a Netpbm image as
output, with the same format, maxval, and dimensions as the input.
pamfunc applies a simple transfer function to each sample in the input
to generate the corresponding sample in the output. The options
determine what function.

pamarith is the same thing for binary functions -- it takes two images
as input and applies a specified simple arithmetic function (e.g.
addition) on pairs of samples from the two to produce the single out-
put image.













For the arithmetic functions, the maxval has no meaning. The function
applies to the sample value as an integer. (Note that this differs
from the usual interpretation of PAM samples as being a fraction of a
maxval, but does produce more intuitive result: 2 times 5 is 10.

But with the bit string operations, the maxval has a special meaning.
The functions in question are: -andmask, -ormask, -xormask, -not,
-shiftleft, and -shiftright.

With these, each sample value the input image, and in the output
image, represents a bit string, not a number. The maxval tells how
wide the bit string is. The maxval must be a full binary count (a
power of two minus one, such as 0xff) and the number of ones in it is
the width of the bit string.

For a masking function, the mask value you specify must not have more
significant bits than the width indicated by the maxval.

For a shifting operation, the shift count you specify must not be
greater than the width indicated by the maxval.

The maxval of the output image is the same as that of the input image.

ppmdim, ppmbrighten, pamdepth, pamarith, pamsummcol,
pamsumm, ppmfade, pnminvert, pam, pnm,

This program was added to Netpbm in Release 10.3 (June 2002).