Created
April 3, 2020 04:47
-
-
Save mongonta0716/275c41a93c08cd8f9131f41f2461f224 to your computer and use it in GitHub Desktop.
ImageMagickを使って8bit bmpから4bit bmpへ一括変換するシェル。colorpalette.pngは16色のカラーパレット情報を持ったpngファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "" ] | |
then | |
echo "引数にリストファイルを指定してください" | |
exit | |
fi | |
for i in $(cat $1) | |
do | |
echo "-------------------" | |
echo "Target File: ${i}" | |
filename=${i%.bmp} | |
echo "${filename}" | |
convert "${filename}.bmp" +dither -map colorpalette.png -colors 16 BMP3:"${filename}_4bit.bmp" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment