Linux Tips : Reducing Size of Digital Camera Photos


You have 100 photos which was captured by using your 5 MP digital camera.Each Image has occupied 4 MB in your memory card and also You want to upload all the files into picasa or facebook or an other social networking sites.
But the maximum image uploading size is 1 MB in those websites. So it is very difficult to reduce the size of each and every photo using some photo editing softwares. In this situation you can use the following shell script to convert or compress more than one images. Let us assume, the photos are available in /home/photos folder.
# cd /home/photos
# vim compress.sh
1
2
3
4
for img in `ls *.JPG`
do
convert -quality 40% $img my-$img
done
or
Simply copy the script and paste into your image folder. and run the script in your terminal


# chmod 777 compress.sh
# ./compress.sh
This script will reduce the size of image into approximately 300 KB .

No comments:

Post a Comment