出力先を指定
-pathオプションを使う。
# リサイズした画像を、一つ上の階層のoutputディレクトリに保存する mogrify -path ../output -resize 128x *.jpg
$ mogrify -help ... Image Settings: ... -path path write images to this path on disk
mogrify & convert
クロップ(切り出す)
$ mogrify -crop "100x200+10+20"
https://www.imagemagick.org/script/command-line-options.php#crop
矩形で塗りつぶす
$ mogrify -fill black \ -draw "rectangle 10,20,110,120"
https://www.imagemagick.org/script/command-line-options.php#draw http://imagemagick.rulez.jp/archives/744
四角の枠で囲う
http://d.hatena.ne.jp/iww/20120809/imagemagick 参考
# 枠線を書く順番
# 上辺
# 右辺
# 左辺
# 下辺
convert -stroke red -strokewidth 5 \
-draw "stroke-linecap square \
line ${lefttop_x},${lefttop_y} ${rightbottom_x},${lefttop_y} \
line ${rightbottom_x},${lefttop_y} ${rightbottom_x},${rightbottom_y} \
line ${lefttop_x},${lefttop_y} ${lefttop_x},${rightbottom_y} \
line ${lefttop_x},${rightbottom_y} ${rightbottom_x},${rightbottom_y} \
" ${src_image_file} ${output_image_file}
その他
findコマンドで見つけたファイルを変換
$ find . -name "*.png" | xargs mogrify -resize 224x