Convert an SGI file to a PNM file. More information: https://netpbm.sourceforge.net/doc/sgitopnm.html.
sgitopnm path/to/input.sgi > path/to/output.pnm
sgitopnm -verbose path/to/input.sgi > path/to/output.pnm
sgitopnm -channel n path/to/input.sgi > path/to/output.pnm