Skip to content

Instantly share code, notes, and snippets.

@baoilleach
Last active December 11, 2018 13:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save baoilleach/5983218 to your computer and use it in GitHub Desktop.
Save baoilleach/5983218 to your computer and use it in GitHub Desktop.
Create an animated gif to morph between images using ImageMagick
convert CID10033747.png CID9919714.png CID10033747.png -loop 0 -morph 9 -gravity South -annotate 1x1 "%t" -set delay "%[fx:(t%10!=0 || t==n-1)?10:240]" morph.gif
@jacksnodgrass
Copy link

can you explain / comment on:
-set delay "%[fx:(t%10!=0 || t==n-1)?10:240]"

I morphed 3 images together.. it takes 3-4 seconds for the first 2 images to morph to completion,
The 2nd -> 3rd image seems to morph faster.. and then it only shows the 3rd image for about half a second and then it starts over again.

how can you do a constant transition time between images AND have the last one display for the same amount of time before starting over?

thanks - jack

@baoilleach
Copy link
Author

Hi Jack, sorry I missed your comment a while back. Looking at the expression, it seems to be setting a long delay (240ms) if it's every tenth frame and it's not the last frame. My guess is that the "morph 9" is related to the tenth frame business, and that as it's a loop there's no need to pause on the final frame as it will be pausing on the identical first frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment