#! /bin/csh -f

foreach f ( `cd pgm-512x512/ && ls *.pgm | sed -e 's:[.]pgm::g'` )
  echo $f
  cat pgm-512x512/$f.pgm | pnmscale -xsize 256 | pgmnorm -bpercent 0 -wpercent 2 | pnmdepth 255 > pgm-256x256-tmp/$f.pgm
  cat pgm-512x512/$f.pgm | pnmscale -xsize 128 | pgmnorm -bpercent 0 -wpercent 2 | pnmdepth 255 > pgm-128x128-tmp/$f.pgm
end
