Created
April 10, 2020 15:44
Star
You must be signed in to star a gist
gifsquid 0.6 fix
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
| cls | |
| @echo off | |
| SETLOCAL | |
| if not "%1"=="" goto param | |
| :INTERACTIVE | |
| set "giffps=24" | |
| set "gifmem=2000" | |
| set "inputpath=frames" | |
| set "outputpath=output" | |
| set /P giffps="Enter desired FPS (default 24): " | |
| set /P gifmem="Enter max RAM usage in MB eg enter '3000' to use 3 Gigabytes of RAM (default 2000): " | |
| if giffps==NUL set giffps=24 | |
| if gifmem==NUL set gifmem=2000 | |
| if inputpath==NUL set "inputpath=frames" | |
| if outputpath==NUL set "outputpath=output" | |
| goto make | |
| :PARAM | |
| set giffps=%1 | |
| set gifmem=%2 | |
| set "inputpath=%3" | |
| set "outputpath=%4" | |
| set giffuzz=%5 | |
| set gifwidth=%6 | |
| set ditherSettings=%7 | |
| set ditherSettings=%ditherSettings:"=% | |
| if [%3]==[] set "inputpath=%~dp0frames" | |
| if [%4]==[] set "outputpath=%~dp0output" | |
| :MAKE | |
| REM cls | |
| REM if not exist %outputpath%\NUL echo output folder does not exist, creating | |
| if not exist %outputpath%\ (mkdir %outputpath%) else echo Output folder exists, cool! | |
| echo Creating GIF at %giffps% frames per second. Max memory consumption %gifmem% MB | |
| echo. | |
| type squidpic.dll | |
| echo. | |
| echo Relax while we squeeze your frames! | |
| echo. | |
| echo When we're done, we'll ask you if you want to keep your PNG sequence. | |
| @echo off | |
| bin\convert +repage -dispose Previous -fuzz %giffuzz%%% -delay 1x%giffps% -limit memory %gifmem%MB -loop 0 %inputpath%/*.png[%gifwidth%x] %ditherSettings% %outputpath%/largeGIF.gif | |
| %SystemRoot%\explorer.exe "%outputpath%" | |
| REM bin\convert +repage -fuzz %giffuzz%%% -delay 1x%giffps% -limit memory %gifmem%MB -loop 0 %inputpath%/*.png[%gifwidth%x] -ordered-dither o4x4,6,6,3 %outputpath%/smallGIF.gif | |
| REM %SystemRoot%\explorer.exe "%outputpath%" | |
| REM bin\convert +repage -fuzz %giffuzz%%% -delay 1x%giffps% -limit memory %gifmem%MB -loop 0 %inputpath%/*.png[%gifwidth%x] -ordered-dither o4x4,6,6,3 -layers OptimizeTransparency %outputpath%/smallestGIF.gif | |
| REM %SystemRoot%\explorer.exe "%outputpath%" | |
| Echo GIF is all done! | |
| echo. | |
| set /P delpng="Keep your PNG sequence? (y/n): " | |
| IF /I "%delpng%"=="n" del.exe /f /s /q %inputpath%\*.png (exit) | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment