pampick
Pick images out of a multi-image Netpbm stream.
TLDR
Execute a shell command on each image in a Netpbm file
$ pampick [image_number1 image_number2 ...] < [path/to/image.pam] > [path/to/output.pam]
Execute a shell command on each image in a Netpbm file