pnmcrop
Updated: 18 March 2001
Table Of Contents
NAME
pnmcrop - crop a PNM image
SYNOPSIS
pnmcrop [-white|-black|-sides] [-left] [-right] [-top] [-bot-
tom] [pnmfile]
All options may be abbreviated to their shortest unique prefix
or specified
with double hyphens.
DESCRIPTION
This program is part of Netpbm.
pnmcrop reads a PBM, PGM, or PPM image as input, removes bor-
ders that are
the background color, and produces the same type of image as
output.
If you don't specify otherwise, pnmcrop assumes the background
color is
whatever color the top left and right corners of the image are
and if they
are different colors, something midway between them. You can
specify that
the background is white or black with the -white and -black
options or make
pnmcrop base its guess on all four corners instead of just two
with -sides.
By default, pnmcrop chops off any stripe of background color
it finds, on
all four sides. You can tell pnmcrop to remove only specific
borders with
the -left, -right, -top, and -bottom options.
If you want to chop a specific amount off the side of an im-
age, use pamcut.
If you want to add different borders after removing the exist-
ing ones, use
pnmcat or pamcomp.
OPTIONS
-white
Take white to be the background color. pnmcrop removes
borders which
are white.
-black
Take black to be the background color. pnmcrop removes
borders which
are black.
-sides
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 col-
or, pnmcrop
takes that as the background color. If not, pnmcrop
looks for two
corners of the same color in the following order, tak-
ing the first
found as the background color: top, left, right, bot-
tom. If all four
corners are different colors, pnmcrop assumes an aver-
age 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.
-left
Remove any left border.
-right
Remove any right border.
-top
Remove any top border.
-bottom
Remove any bottom border.
-verbose
Print on Standard Error information about the process-
ing, including
exactly how much is being cropped off of which sides.
SEE ALSO
pamcut, pamfile, pnm
AUTHOR
Copyright (C) 1989 by Jef Poskanzer.
_________________________________________________________________
Table Of Contents
* NAME
* SYNOPSIS
* DESCRIPTION
* OPTIONS
* SEE ALSO
* AUTHOR
UNIX/Linux commands referenced on this page:
- as
- top
- pnmcat
- which
- at
- pamcut
- pamfile