Source

mudo / converte_imagens.sh

cd frames
for img in *.png
do
  
  #nr=`expr 0 + ${img/.png/}`

  gray=../frames_gray/$img
  if [ ! -e $gray ]
  then
      echo A gerar $gray
      convert $img -type Grayscale -blur 5 -blur 5 $gray
      sleep 0.1
  fi

  echo A apagar $img
  rm $img
done