CNT=0
for i in $(ls …/img)
do
ID=${i%.*}
ID=${ID##*/}
if [ $CNT -le 20 ];then
convert -border 100x0 -bordercolor black ../img/${i} ${ID}.jpg
elif [ $CNT -le 70 ];then
convert -border 0x50 -bordercolor black ../img/${i} ${ID}.jpg
else
convert -border 40x100 -bordercolor black ../img/${i} ${ID}.jpg
fi
CNT=`expr $CNT + 1`
done