Skip to content

Instantly share code, notes, and snippets.

@hellphish
Created April 10, 2020 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellphish/95a16d940f96a0bf8f6f3b3d16258708 to your computer and use it in GitHub Desktop.
Save hellphish/95a16d940f96a0bf8f6f3b3d16258708 to your computer and use it in GitHub Desktop.
gifsquid 0.6 fix
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