pnmcrop(1) crop a portable anymap


pnmcrop [-white|-black|-sides] [-left] [-right] [-top] [-bottom] [pnmfile]

All options may be abbreviated to their shortest unique prefix or specified with double hyphens.


Take white to be the background color. pnmcrop removes borders which are white.
Take black to be the background color. pnmcrop removes borders which are black.
Determine the background color from the colors of the four corners of the input image. pnmcrop removes borders which are of the background color.

If at least three of the four corners are the same color, pnmcrop takes that as the background color. If not, pnmcrop looks for two corners of the same color in the following order, taking the first found as the background color: top, left, right, bottom. If all four corners are different colors, pnmcrop assumes an average of the four colors as the background color.

The -sides option slows pnmcrop down, as it reads the entire image to determine the background color in addition to the up to three times that it would read it without -sides.

Remove any left border.
Remove any right border.
Remove any top border.
Remove any bottom border.
Print on Standard Error information about the processing, including exactly how much is being cropped off of which sides.


Copyright (C) 1989 by Jef Poskanzer.