centos 安装 ImageMagick

ImageMagick很好用,shell下可以批量对图片做处理,很赞!~

编译安装

wget http://www.imagemagick.org/download/ImageMagick.tar.gz
cd ImageMagick.tar.gz 
tar -zxvf ImageMagick.tar.gz 
cd ImageMagick-6.8.8-8/
./configure
make
make install

批量压缩shell

for img in `find ./ -name "*.[jJ][pP][gG]"`; do
                convert -strip -quality 75% $img $img-resized;
                rm $img;
                mv $img-resized $img
                echo $img
done
for img in `find ./ -name "*.[pP][nN][gG]"`; do
                convert -strip -quality 75% $img $img-resized;
                rm $img;
                mv $img-resized $img
                echo $img
done
for img in `find ./ -name "*.[gG][iI][fF]"`; do
                convert -strip -quality 75% $img $img-resized;
                rm $img;
                mv $img-resized $img
                echo $img
done

 

posted on 2014-03-19 19:11  一天一點  阅读(635)  评论(0编辑  收藏  举报