#bash + netpbm, 30 bytes
bash + netpbm, 30 bytes
pnmdepth 1|pnmscale -nomix 0.5
Takes input on stdin as a PNM file, and outputs on stdout as a PNM file.
pnmdepth 1
reduces the depth of the image on its stdin to 1, and pnmscale 0.5
reduces the size by a half in each direction. The -nomix
option is required for pnmscale
to choose a pixel from the starting image for each output pixel, instead of mixing adjacent input pixels into one output pixel.