pnmcrop
Crop PNM images. tldr-pages
On several platforms
Several platforms
Remove white borders on a PNM image
pnmcrop -white path/to/image.pnm >path/to/output.pnmIdentifyRemove borders of the specified color that are on the top and left side of the image
pnmcrop -bg-color color -top -left path/to/image.pnm >path/to/output.pnmIdentifyDetermine the color of the borders to be removed by the color of the pixel in the specified corner
pnmcrop -bg-corner topleft path/to/image.pnm >path/to/output.pnmIdentifyLeave a border with a width of n pixels. Additionally, specify the behavior if the image is entirely made out of background
pnmcrop -margin n -blank-image pass path/to/image.pnm >path/to/output.pnmIdentify