Convert PostScript image data to a PGM image. More information: https://netpbm.sourceforge.net/doc/psidtopgm.html.
psidtopgm width height bits_per_sample path/to/file.ps > path/to/image.pgm