#!/bin/sh

if [ "$1" = "" ]; then
  echo "Specify filename"
  exit
fi

FILE=$1

LIST_REQ=`cat required.txt`

FLG=1
if [ "$FLG" = 1 ]; then
  for i in $LIST_REQ ; do
    echo "strip, convert, and copy: $i -> ../$i"
    magick $i -strip -background '#000000' -alpha remove -alpha off -define png:color-type=0 -define png:bit-depth=8 _tmp_.png
    magick _tmp_.png -threshold '0.2%' -define png:color-type=0 -define png:bit-depth=8 ../$i
    rm -f _tmp_.png
  done
fi

magick aquila.png -rotate 90 -roll -23+60 -strip -background '#000000' -alpha remove -alpha off -define png:color-type=0 -define png:bit-depth=8 _tmp_.png
magick _tmp_.png -threshold '0.2%' -define png:color-type=0 -define png:bit-depth=8 ../aquila.rotated.png
rm -f _tmp_.png

