Created
April 1, 2018 02:40
-
-
Save walfie/253e8ea16293cae59a72ef85aef749e0 to your computer and use it in GitHub Desktop.
gif from png sequence for twitter
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
# Let's say an animation has frames {1,2,3,4}.png and is 24fps. | |
# To make it loop nicely on twitter, we want something like: | |
# | |
# 1 1 2 2 3 3 4 | |
# | |
# at 48fps. The below command, using a bunch of hacks, will | |
# take a PNG sequence and create a gif with the above sequence. | |
# Note that 2.0833333... is 1/48, e.g., 48fps. | |
convert -limit thread 1 -delay 2.0833333333 $(echo *.png *.png | sed 's/ /\n/g' | sort | head -n $(( $(ls -l *.png *.png | wc -l) - 1 )) ) out.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment