Leave a border with a width of `n` pixels. Additionally, specify the behaviour if the image is entirely made out of background
pnmcrop -margins n -blank-image pass|minimize|maxcrop path/to/image.pnm > path/to/output.pnm