Skip to content

Instantly share code, notes, and snippets.

@Quackward
Created January 22, 2021 06:40
Show Gist options
  • Save Quackward/bf1be91a56502cb3e7eade6a0a3b16cd to your computer and use it in GitHub Desktop.
Save Quackward/bf1be91a56502cb3e7eade6a0a3b16cd to your computer and use it in GitHub Desktop.
@echo off
:: HEYA!!
:: edit the next line to your aseprite.exe's complete path like ("C:/path/to/asesprite.exe") include quotes
set asepritePath="C:/Program Files (x86)/Steam/steamapps/common/Aseprite/Aseprite.exe"
:: this is the added bit to the output file's name
set convertFilenameAdd=_prev
:: Converts asesprite's format to gif
:: drag and drop as many gif or png as you want
:: clairvoire@gmail.com
:: ----------------------------------------------------------------------------------------------------------
if not exist %asepritePath% (
echo please edit the .bat file, with the path to your aseprite executable
echo it is currently %asepritePath%
pause
goto :eof
)
if "%~1" == "" (
echo You gotta drag the aseprites onto this bat for it to work
echo You can drop as many files as you like"
echo The outputted gif files will have the same name as the gif and png...
echo ... with this appended: "%convertFilenameAdd%.aseprite"
echo If a file of that name already exists, it will NOT overwrite it for safety
pause
goto :eof
)
:loop
if not "%~x1" == ".aseprite" (
echo %~1 isn't an aseprite file, skipping it
pause
) else (
%asepritePath% -b "%~1" --save-as "%~dpn1%convertFilenameAdd%.gif"
)
shift
if not "%~1" == "" goto loop
@echo off
:: HEYA!!
:: edit the next line to your aseprite.exe's complete path like ("C:/path/to/asesprite.exe") include quotes
set asepritePath="C:/Program Files (x86)/Steam/steamapps/common/Aseprite/Aseprite.exe"
:: this is the added bit to the output file's name
set convertFilenameAdd=_export
:: Converts gifs and pngs to asesprite's format
:: drag and drop as many gif or png as you want
:: clairvoire@gmail.com
:: ----------------------------------------------------------------------------------------------------------
if not exist %asepritePath% (
echo please edit the .bat file, with the path to your aseprite executable
echo it is currently %asepritePath%
pause
goto :eof
)
if "%~1" == "" (
echo You gotta drag the gifs and pngs onto this bat for it to work
echo You can drop as many files as you like"
echo The outputted aseprite files will have the same name as the gif and png...
echo ... with this appended: "%convertFilenameAdd%.aseprite"
echo If a file of that name already exists, it will NOT overwrite it for safety
pause
goto :eof
)
:loop
if exist "%~dpn1%convertFilenameAdd%.aseprite" (
echo "%~dpn1%convertFilenameAdd%.aseprite" already exists, skipping...
echo this will not overwrite things for safety; delete it if you want to replace it
pause
) else (
if not "%~x1" == ".gif" (
if not "%~x1" == ".png" (
echo %~1 isn't a gif or png, skipping it
pause
) else (
%asepritePath% -b "%~1" --save-as "%~dpn1%convertFilenameAdd%.aseprite"
)
) else (
%asepritePath% -b "%~1" --save-as "%~dpn1%convertFilenameAdd%.aseprite"
)
)
shift
if not "%~1" == "" goto loop
@echo off
:: HEYA!!
:: edit the next line to your aseprite.exe's complete path like ("C:/path/to/asesprite.exe") include quotes
set asepritePath="C:/Program Files (x86)/Steam/steamapps/common/Aseprite/Aseprite.exe"
:: this is the added bit to the output file's name
set convertFilenameAdd=x2
:: Uses aseprite to upscale gifs or pngs
:: drag and drop as many gif or png as you want
:: clairvoire@gmail.com
:: ----------------------------------------------------------------------------------------------------------
if not exist %asepritePath% (
echo please edit the .bat file, with the path to your aseprite executable
echo it is currently %asepritePath%
pause
goto :eof
)
if "%~1" == "" (
echo You gotta drag the gifs and pngs onto this bat for it to work
echo You can drop as many files as you like"
echo The outputted aseprite files will have the same name as the gif and png...
echo ... with this appended: "%convertFilenameAdd%%~x1"
pause
goto :eof
)
:loop
if not "%~x1" == ".gif" (
if not "%~x1" == ".png" (
echo %~1 isn't a gif or png, skipping it
pause
) else (
%asepritePath% -b "%~1" --scale 2 --save-as "%~dpn1%convertFilenameAdd%.png"
)
) else (
%asepritePath% -b "%~1" --scale 2 --save-as "%~dpn1%convertFilenameAdd%.gif"
)
shift
if not "%~1" == "" goto loop
@echo off
:: HEYA!!
:: edit the next line to your aseprite.exe's complete path like ("C:/path/to/asesprite.exe") include quotes
set asepritePath="C:/Program Files (x86)/Steam/steamapps/common/Aseprite/Aseprite.exe"
:: this is the added bit to the output file's name
set convertFilenameAdd=x2
:: Uses aseprite to upscale gifs or pngs
:: drag and drop as many gif or png as you want
:: clairvoire@gmail.com
:: ----------------------------------------------------------------------------------------------------------
if not exist %asepritePath% (
echo please edit the .bat file, with the path to your aseprite executable
echo it is currently %asepritePath%
pause
goto :eof
)
if "%~1" == "" (
echo You gotta drag the gifs and pngs onto this bat for it to work
echo You can drop as many files as you like"
echo The outputted aseprite files will have the same name as the gif and png...
echo ... with this appended: "%convertFilenameAdd%%~x1"
pause
goto :eof
)
:loop
if not "%~x1" == ".gif" (
if not "%~x1" == ".png" (
echo %~1 isn't a gif or png, skipping it
pause
) else (
%asepritePath% -b "%~1" --scale 3 --save-as "%~dpn1%convertFilenameAdd%.png"
)
) else (
%asepritePath% -b "%~1" --scale 3 --save-as "%~dpn1%convertFilenameAdd%.gif"
)
shift
if not "%~1" == "" goto loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment