ppmchange

change all pixels of one color to another in a portable pixmap

copy
1
0
ppmchange -remainder=black red red

source | details |

copy
0
0
ppmchange -remainder=black red white | ppmtopgm

source | details |