Convert a PPM file to an Atari Spectrum 512 image. More information: https://netpbm.sourceforge.net/doc/ppmtospu.html.
ppmtospu path/to/input.ppm > path/to/output.spu
ppmtospu -d0|2|4 path/to/input.ppm > path/to/output.spu