-->

Previous | Table of Contents | Next

Page 389

OPTIONS

-size Controls how big each image becomes; the default is 100x100.
-across Controls how many images are in each row; the default is six.
-colors Controls how many colors the final index gets quantized to, if quantization is necessary; the default is 256.
-black Controls the color of the padding between the images; normally it's white and the labels are black lettering on white background, but the -black flag reverses this.

SEE ALSO


pnmscale(1), pnmcat(1), pbmtext(1), ppmquant(1),

pnm(5)

BUGS

It's very slow.

It's a csh script. csh scripts are not portable to System V. Scripts in general are not portable to non-UNIX environments.

AUTHOR

Copyright " 1991 by Jef Poskanzer.

9 January 1991

pnminvert

pnminvert—Invert a portable anymap

SYNOPSIS


pnminvert [pnmfile]

DESCRIPTION

pnminvert reads a portable anymap as input, inverts it black for white, and produces a portable anymap as output.

SEE ALSO


pnm(5)

AUTHOR

Copyright " 1989 by Jef Poskanzer.

8 August 1989

pnmmargin

pnmmargin—Add a border to a portable anymap

SYNOPSIS


pnmmargin [-white|-black|-color colorspec] size [pnmfile]

DESCRIPTION

pnmmargin reads a portable anymap as input, adds a border of the specified number of pixels, and produces a portable anymap as output.

Page 390

OPTIONS

You can specify the border color with the -white, -black, and -color flags. If no color is specified, the program makes a guess.

SEE ALSO


pnm(5)

BUGS

It's a script. Scripts are not portable to non-UNIX environments.

AUTHOR

Copyright " 1991 by Jef Poskanzer.

9 January 1991

pnmnlfilt

pnmnlfilt--Nonlinear filters: smooth, alpha trim mean, optimal estimation smoothing, edge enhancement.

SYNOPSIS


pnmnlfilt alpha radius [pnmfile]

DESCRIPTION

This is something of a Swiss army knife filter. It has three distinct operating modes. In all of the modes, each pixel in the image is examined and processed according to it and its surrounding pixels values. Rather than using the nine pixels in a 3¥3 block, seven hexagonal area samples are taken, the size of the hexagons being controlled by the radius parameter. A radius value of 0.3333 means that the seven hexagons exactly fit into the center pixel (that is, there will be no filtering effect). A radius value of 1.0 means that the seven hexagons exactly fit a 3¥3 pixel array.

Alpha-Trimmed Mean Filter (0.0 < = alpha < = 0.5)

The value of the center pixel will be replaced by the mean of the seven hexagon values, but the seven values are sorted by size and the top and bottom alpha portion of the seven are excluded from the mean. This implies that an alpha value of 0.0 gives the same sort of output as a normal convolution (that is, averaging or smoothing filter), where radius will determine the "strength" of the filter. A good value to start from for subtle filtering is alpha = 0.0, radius = 0.55. For a more blatant effect, try alpha = 0.0 and radius = 1.0.

An alpha value of 0.5 will cause the median value of the seven hexagons to be used to replace the center pixel value. This sort of filter is good for eliminating "pop" or single pixel noise from an image without spreading the noise out or smudging features on the image. Judicious use of the radius parameter will fine-tune the filtering. Intermediate values of alpha give effects somewhere between smoothing and "pop" noise reduction. For subtle filtering, try starting with values of alpha = 0.4, radius = 0.6. For a more blatant effect, try alpha = 0.5, radius = 1.0.

Optimal Estimation Smoothing. (1.0 < = alpha < = 2.0)

This type of filter applies a smoothing filter adaptively over the image. For each pixel, the variance of the surrounding hexagon values is calculated, and the amount of smoothing is made inversely proportional to it. The idea is that if the variance is small, then it is due to noise in the image, while if the variance is large, it is because of "wanted" image features. As usual, the radius parameter controls the effective radius, but it probably advisable to leave the radius between 0.8 and 1.0 for the variance calculation to be meaningful. The alpha parameter sets the noise threshold, over which less smoothing will be done. This means that small values of alpha will give the most subtle filtering effect, while large values will tend to smooth all parts of the image. You could start with values like alpha = 1.2, radius = 1.0 and try increasing or decreasing the alpha parameter to get the desired effect. This type of filter is best for filtering out dithering noise in both bitmap and color images.

Previous | Table of Contents | Next