Skip to content

Instantly share code, notes, and snippets.

@eguneys
Created February 7, 2022 22:16
Show Gist options
  • Save eguneys/4b126d5a924b3cc2e8d2b43b6a1dcf11 to your computer and use it in GitHub Desktop.
Save eguneys/4b126d5a924b3cc2e8d2b43b6a1dcf11 to your computer and use it in GitHub Desktop.
Pixel Save
#!/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