Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active December 12, 2018 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baobao/7853e23079a5701406bf758000554417 to your computer and use it in GitHub Desktop.
Save baobao/7853e23079a5701406bf758000554417 to your computer and use it in GitHub Desktop.
フォルダ内のjpgをexport/同名.pngに書き出す
#required imagemagick
# フォルダ内のjpgをexport/同名.pngに書き出す
extension='jpg'
mkdir -p export
for fileNameWithEx in *.$extension ; do
# 拡張子を取る
fileName=${fileNameWithEx/.*/}
# jpg => png
convert $fileNameWithEx export/${fileName}.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment