Last active
March 9, 2022 00:54
-
-
Save Calinou/a1ac5604c7acc407dbb060682d76e57b to your computer and use it in GitHub Desktop.
Script to create a map of a Minetest world (then optimize it using oxipng)
This file contains hidden or 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 | |
set -euo pipefail | |
MAP_DIR="/home/hugo/.minetest/worlds/calinou" | |
TEMP_FILE="/tmp/map_calinou.png" | |
OUTPUT_FILE="/var/www/games.hugo.pro/minetest/map_calinou.png" | |
echo "Rendering map, this may take a while…" | |
/usr/local/bin/minetestmapper \ | |
--input "$MAP_DIR" \ | |
--output "$TEMP_FILE" \ | |
--drawscale --drawalpha \ | |
--scalecolor "#eeeeee" --bgcolor "#0e0e0e" | |
echo "Optimizing image, this may take a while…" | |
/home/hugo/.cargo/bin/oxipng "$TEMP_FILE" | |
echo "Moving temporary file to final destination…" | |
rm -f "$OUTPUT_FILE" | |
mv "$TEMP_FILE" "$OUTPUT_FILE" | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment