Saturday, June 6, 2009

Image Format Convertor : Script

To Covert all images from one folder from one format to another format

Create file test.sh
Add following line to that file

for i in *png

do
echo $i
temp=$(echo $i | sed -e 's|\.png||')
convert -resize 640x200 $i $temp.gif
done

Save file
Chmod +x test.sh
Run File : ./test.sh


Here I have used .png and .gif. We can try with other .jpg, .jpeg, tif, ttf, bmp etc.