pamcut
extracts a rectangular region from a PAM or PNM image
TLDR
Cut region from image
$ pamcut [x] [y] [width] [height] [input.pam] > [output.pam]
Cut from coordinates$ pamcut -left [100] -top [50] -width [200] -height [150] [input.pam] > [output.pam]
Cut right portion$ pamcut -right [100] -bottom [100] -width [200] -height [200] [input.pam] > [output.pam]
Pad if outside bounds$ pamcut -pad -left [-10] -top [-10] -width [300] -height [300] [input.pam] > [output.pam]
SYNOPSIS
pamcut [options] [x y width height] [pamfile]
DESCRIPTION
pamcut extracts a rectangular region from a PAM or PNM image. Coordinates can be specified from any corner using combinations of left/right and top/bottom.
PARAMETERS
-left x
Left edge position.-right x
Right edge position.-top y
Top edge position.-bottom y
Bottom edge position.-width w
Output width.-height h
Output height.-pad
Pad with black if outside.
EXAMPLE
$ # Cut 100x100 from top-left corner
pamcut 0 0 100 100 photo.ppm > crop.ppm
# Cut center region
pamcut -left 100 -top 100 -width 200 -height 200 input.ppm > center.ppm
pamcut 0 0 100 100 photo.ppm > crop.ppm
# Cut center region
pamcut -left 100 -top 100 -width 200 -height 200 input.ppm > center.ppm
CAVEATS
Coordinates are 0-indexed. Without -pad, region must be within image bounds.
HISTORY
pamcut is part of Netpbm, evolving from the original PBMplus toolkit created by Jef Poskanzer.
