Skip to content

Instantly share code, notes, and snippets.

@jeremyjordan
Created May 13, 2023 14:56
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 jeremyjordan/5e119c4b8aaa99921131663e2937d54d to your computer and use it in GitHub Desktop.
Save jeremyjordan/5e119c4b8aaa99921131663e2937d54d to your computer and use it in GitHub Desktop.
Create GIF from images
# Create a directory with images named 1.jpg, 2.jpg, 3.jpg, etc.
# Generate a custom color palette
ffmpeg -framerate 0.5 -i %d.jpg \
-vf "format=rgba,fps=0.5,palettegen=stats_mode=diff" \
-y palette.png
# Create the gif
ffmpeg -framerate 0.5 -i %d.jpg -i palette.png \
-lavfi "format=rgba,fps=0.5,paletteuse=dither=none" \
-y output.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment