pnmquantall

Run pnmquant on multiple files at once such that they share a common colormap. See also: pnmquant. More information: https://netpbm.sourceforge.net/doc/pnmquantall.html.

pnmquantall n_colors path/to/input1.pnm path/to/input2.pnm ...

pnmquantall -ext extension n_colors path/to/input1.pnm path/to/input2.pnm ...