HomeBrewでImageMagickをインストール
$ brew install imagemagick
インストールの確認
$ convert
画像の情報を表示する
$ magick identify rose.jpg
*結果
rose.jpg JPEG 70x46 70x46+0+0 8-bit sRGB 2.36KB 0.000u 0:00.000
Filename[frame #] image-format widthxheight page-widthxpage-height+x-offset+y-offset colorspace user-time elapsed-time
画像情報を一覧表示(カレントディレクトリ内の全画像)
$cd <該当ディレクトリのパス> *該当ディレクトリに移動
$ magick identify *
フォーマット変更した画像を追加
(image.jpgのフォーマットを変更したimage.pngを追加 )
$ magick image.jpg image.png
カレントディレクトリ内の全画像のフォーマットを一覧表示
$ magick identify -format "%w %h\n" *
長編1000pxでリサイズ(カレントディレクトリ内の全画像)
$ mogrify -resize 1000x1000 *
長編1000pxより大きい場合にリサイズ(カレントディレクトリ内の全画像)
$ mogrify -resize 1200x1200\> *
参考:
https://imagemagick.org/script/identify.php
https://fukatsu.tech/install-imagemagick
https://photo-tea.com/p/17/imagemagick-resize-watermark/
https://toshio-web.com/linux-mint-photo-resize