Skip to content

Instantly share code, notes, and snippets.

@mongonta0716
Created April 3, 2020 04:47
Show Gist options
  • Save mongonta0716/275c41a93c08cd8f9131f41f2461f224 to your computer and use it in GitHub Desktop.
Save mongonta0716/275c41a93c08cd8f9131f41f2461f224 to your computer and use it in GitHub Desktop.
ImageMagickを使って8bit bmpから4bit bmpへ一括変換するシェル。colorpalette.pngは16色のカラーパレット情報を持ったpngファイル
#!/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