Created
February 7, 2022 22:16
-
-
Save eguneys/4b126d5a924b3cc2e8d2b43b6a1dcf11 to your computer and use it in GitHub Desktop.
Pixel Save
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 | |
FOLDER=$1 | |
OUT=$2 | |
OPTIPNG="D:/programs/optipng-0.7.7-win32/optipng.exe" | |
ASEPRITE="C:/Program Files/Aseprite/aseprite.exe" | |
files="sprites | |
sprites2" | |
if [[ $FOLDER == "" || ! -d $FOLDER || $OUT == "" ]]; then | |
echo "usage: ./save.sh folder outdir" | |
exit | |
fi | |
for filename in $files | |
do | |
file="$FOLDER/$filename.aseprite" | |
if [ -f "$file" ]; then | |
"$ASEPRITE" -b $file --save-as $FOLDER/export/$filename.png | |
"$OPTIPNG" -o7 $FOLDER/export/$filename.png | |
else | |
echo "skipping $file" | |
fi | |
done | |
scp $FOLDER/export/*.png $OUT/assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment