pnmrotate

Rotate a PNM image. More information: https://netpbm.sourceforge.net/doc/pnmrotate.html.

pnmrotate angle path/to/input.pnm > path/to/output.pnm

pnmrotate -background color angle path/to/input.pnm > path/to/output.pnm

pnmrotate -noantialias angle path/to/input.pnm > path/to/output.pnm