0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

画像のファイル形式をコマンドで一括変換

Posted at

目的

画像の拡張子を.png.jpgなどに相互変換できるようにしたい。 備忘録。

環境

シェル:zsh

事前準備

Homebrewで必要なコマンドをインストール。

brew install imagemagick

方法

例としてiPhoneで撮った拡張子.heicの複数枚の写真を.pngに一括変換してみる。

1枚のみ変換する場合

convertコマンドを使用。

  • 例.) result.heicresult.pngに変換する。
convert result.heic result.png

複数枚を一括変換する場合

mogrifyコマンドを使用。こっちは-formatオプションが必要。

  • 例.) 全ての.heicファイルを.png形式に変換する。
mogrify -format png *.heic

蛇足

変換元の.heicファイルをディレクトリから全て削除。

rm *.heic

ImageMagickでもっとできることは沢山あるけど今の所これだけしか使ってない、何かあったら追記します。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?