Skip to content

Instantly share code, notes, and snippets.

@Fuwn
Created January 14, 2022 06:54
Show Gist options
  • Save Fuwn/a46805a8bb0ec70dd122a43a434251f6 to your computer and use it in GitHub Desktop.
Save Fuwn/a46805a8bb0ec70dd122a43a434251f6 to your computer and use it in GitHub Desktop.
Image to BMP3 Converter for Worlds
# Check if a filename was supplied
if ! test -n "${1}";
then
echo "bmp-to-bmp3.sh <file.bmp>"
exit 1
fi
# Check if ImageMagick is installed
if ! command -v mogrify &> /dev/null;
then
echo "ImageMagick not found"
exit 1
fi
mogrify -format BMP3 ${1} # file.bmp to file.BMP3
mv ${1}3 ${1} # Rename file.BMP3 to file.bmp
convert -type truecolor ${1} # Convert to 24-bit bit depth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment