psidtopgm
Convert PostScript image data to a PGM image.
TLDR
Convert the image data in a PS file to a PGM image of the specified dimensions and quality
$ psidtopgm [width] [height] [bits_per_sample] [path/to/file.ps] > [path/to/image.pgm]
Convert the image data in a PS file to a PGM image of the specified dimensions and quality