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