Skip to main content
Commonmark migration
Source Link

#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.

#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.

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.

Source Link
pizzapants184
  • 3.5k
  • 15
  • 18

#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.