Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Given a pair of images, how to automatically create an animation sequence morphing one image into the other?

Is there a programmatic way to convert two images into an animation sequence (e.g., an animated GIF) like the following example?

From memrise.com, showing an animated GIF between two images

This image sequence, taken from a http://memrise.com course, doesn't seem to have manually-edited frames, but seems automatically transformed using some kind shape morphing algorithm. Is there a common term used to describe such an animation or algorithm? Is there a feature in ImageMagick or Photoshop/Gimp that generates such animations, given a pair of images?

Ideally the technique could be scriptable so I could create animations for several pairs of start-end images.

Edit: I have just been told about Gimp's tool under Filters->Animation->Blend, which appears to do the same thing as jQuery morph: each frame i is start + (finish - start)/N*i. In other words, you're transitioning each pixel independently from the start value to the finish value, without any shape morphing. The example gives is more complicated, as it modifies the contours of both images to achieve its compelling effect.

Other examples:

  • http://static.memrise.com/uploads/mems/32000121024054535.gif
  • http://static.memrise.com/uploads/mems/225428000121109232837.gif
like image 495
Ahmed Fasih Avatar asked Sep 13 '25 22:09

Ahmed Fasih


1 Answers

I have written a tool that doesn't require setting manual keypoints and is not restricted to a domain (like faces). Anyway, the images have to be similar (e.g. two faces or two cars from the same perspective).

https://github.com/kallaballa/Poppy

There is also a web-version created with emscripten.

flame to glyph morphing

I generated the above animation using following command line:

poppy flame.png glyph.png flame.png

like image 112
kallaballa Avatar answered Sep 17 '25 20:09

kallaballa