commands.sh

pnmcrop

all

Crop PNM images.

More info →

Options (5)

-wboolean

Remove white borders on a PNM image

Example: pnmcrop {{[-w|-white]}} {{path/to/image.pnm}} > {{path/to/output.pnm}}
-tboolean

Remove borders of the specified color that are on the top and left side of the image

Example: pnmcrop -bg-color {{color}} {{[-t|-top]}} {{[-l|-left]}} {{path/to/image.pnm}} > {{path/to/output.pnm}}
-lboolean

Remove borders of the specified color that are on the top and left side of the image

Example: pnmcrop -bg-color {{color}} {{[-t|-top]}} {{[-l|-left]}} {{path/to/image.pnm}} > {{path/to/output.pnm}}
-mboolean

Leave a border with a width of `n` pixels. Additionally, specify the behavior if the image is entirely made out of background

Example: pnmcrop {{[-m|-margin]}} {{n}} {{[-blan|-blank-image]}} {{pass|minimize|maxcrop}} {{path/to/image.pnm}} > {{path/to/output.pnm}}
boolean

Leave a border with a width of `n` pixels. Additionally, specify the behavior if the image is entirely made out of background

Example: pnmcrop {{[-m|-margin]}} {{n}} {{[-blan|-blank-image]}} {{pass|minimize|maxcrop}} {{path/to/image.pnm}} > {{path/to/output.pnm}}

Examples (4)

Remove white borders on a PNM image

pnmcrop [-w|-white] path/to/image.pnm > path/to/output.pnm

Remove borders of the specified color that are on the top and left side of the image

pnmcrop -bg-color color [-t|-top] [-l|-left] path/to/image.pnm > path/to/output.pnm

Determine the color of the borders to be removed by the color of the pixel in the specified corner

pnmcrop -bg-corner topleft|topright|bottomleft|bottomright path/to/image.pnm > path/to/output.pnm

Leave a border with a width of `n` pixels. Additionally, specify the behavior if the image is entirely made out of background

pnmcrop [-m|-margin] n [-blan|-blank-image] pass|minimize|maxcrop path/to/image.pnm > path/to/output.pnm
made by @shridhargupta | data from tldr-pages