1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 22:42:09 +02:00
tldr/pages/common/pnmcrop.md
Antti Savolainen e1d44b5166 batch3
2025-03-28 18:12:09 +02:00

890 B

pnmcrop

Crop PNM images. More information: https://netpbm.sourceforge.net/doc/pnmcrop.html.

  • 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 behaviour 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}}