Batch Image Editing in Linux


Must know for web developers. Many batch tools are available in imagemagick. convert and mogrify are both great! sudo apt-get imagemagick will get you going

bash$ for i in *.jpg
do
convert -scale ’48×38′ $i TN_$i
echo $i processed
done

mogrify -format jpg -quality ‘95%’ *.tiff (bulk-conversion)

For more optimized images use the following:

bash$ for i in *.jpg
do
djpeg $i | pnmscale -xysize 48 38 | cjpeg -opti -progr -qual ‘75%’ > TN_$i
echo $i processed
done

Original post here (look for Tim’s comment):http://www.cyberciti.biz/tips/howto-linux-creating-a-image-thumbnails-from-shell-prompt.html


Advertisements