Ubuntu 下需要安装 ImageMagick。执行
sudo apt-get install imagemagick
使用 shell 脚本遍历当前目录中的所有 png 图片,并逐一处理
set -e # or use "set -o errexit" to quit on error.
set -x # or use "set -o xtrace" to print the statement before you execute it.
FILES=*.png
for f in $FILES
do
echo "$f"
convert $f -resize 600x600 600_$f
done
环境
- Ubuntu 16.10
- ImageMagick 6.8.9