Skip to content

Instantly share code, notes, and snippets.

Last active January 25, 2019 08:19
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hitode909/e4f696869681977c1db6ba6228ad7868 to your computer and use it in GitHub Desktop.
# Create a animation of of a rotating image.
# Some alpha composition is used to crop the result to the original size.
command="convert -delay 10 $1 -resize 50% -trim +repage -bordercolor white"
command="$command \\( +clone -border 1x1 -fill lightsteelblue"
command="$command -colorize 100% \\) -gravity center"
for i in `seq 100 -2 20 ;`; do
command="$command \\( -clone 0 -liquid-rescale 100%x${i}\!"
command="$command -border 1x1 -clone 1 +swap -composite \\)"
# remove source images
command="$command -delete 0,1"
# duplicate frames to reverse
command="$command \\( -clone -2-1 \\)"
# write out animation
command="$command -layers Optimize -loop 0 animated_lqr.gif"
eval $command
chmod 644 animated_lqr.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment