Last active
November 21, 2016 16:33
-
-
Save danalmeida/7233137 to your computer and use it in GitHub Desktop.
Create and optmize gif files through command line, requires ImageMagick and gifsicle
This file contains hidden or 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 | |
# Generate gifs from jpg sequence | |
convert +repage -fuzz 0.0%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-00.gif" | |
convert +repage -fuzz 0.5%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-05.gif" | |
convert +repage -fuzz 1.0%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-10.gif" | |
convert +repage -fuzz 1.5%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-15.gif" | |
convert +repage -fuzz 2.0%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-20.gif" | |
convert +repage -fuzz 2.5%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-25.gif" | |
convert +repage -fuzz 3.0%% -delay 4 -loop 0 *.jpg -layers OptimizePlus -layers OptimizeTransparency "gif-30.gif" | |
# Optimize gifs | |
gifsicle -O3 --colors 128 "gif-00.gif" >"Done-00-128.gif" | |
gifsicle -O3 --colors 256 "gif-00.gif" >"Done-00-256.gif" | |
gifsicle -O3 --colors 128 "gif-05.gif" >"Done-05-128.gif" | |
gifsicle -O3 --colors 256 "gif-05.gif" >"Done-05-256.gif" | |
gifsicle -O3 --colors 128 "gif-10.gif" >"Done-10-128.gif" | |
gifsicle -O3 --colors 256 "gif-10.gif" >"Done-10-256.gif" | |
gifsicle -O3 --colors 128 "gif-15.gif" >"Done-15-128.gif" | |
gifsicle -O3 --colors 256 "gif-15.gif" >"Done-15-256.gif" | |
gifsicle -O3 --colors 128 "gif-20.gif" >"Done-20-128.gif" | |
gifsicle -O3 --colors 256 "gif-20.gif" >"Done-20-256.gif" | |
gifsicle -O3 --colors 128 "gif-25.gif" >"Done-25-128.gif" | |
gifsicle -O3 --colors 256 "gif-25.gif" >"Done-25-256.gif" | |
gifsicle -O3 --colors 128 "gif-30.gif" >"Done-30-128.gif" | |
gifsicle -O3 --colors 256 "gif-30.gif" >"Done-30-256.gif" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment