ppmtopuzz

Convert a PPM image to an X11 puzzle file. More information: https://netpbm.sourceforge.net/doc/ppmtopuzz.html.

ppmtopuzz path/to/file.ppm > path/to/file.puzz