On Thu, 4 Jun 2009 06:48:50 +1000
Graham Williams <[email protected]> wrote:

| I've been trying to find a solution to generating an animation, a
| little like "-morph", that will "move" points inĀ  a simple plot from
| one location in an image to another location in a second image.
| Essentially the two images have objects that are the same unique
| colour in each image, and I want a series of images that move each
| object to its new location, so that I end up with an animated gif that
| looks like it is moving the objects "smoothly."
| 
| I attach two images (generated using R) that illustrate the starting
| and end points.
| 
| Any ideas? The morph option is quite nice when the objects are not too
| far from each other, but not quite what I am after:
| 
| $ convert -delay 50 -morph 10 p?.png movie.gif
| $ animate movie.gif
| 
| Thanks for any help.
| 
-morph is a very old 'quick hack' operation.  It only does a color morphing
from one image to another.

For true morphing you need to distort each of the two images to
the corresponding position for EVERY STEP between the two images.

That is you not only need to distort the first image to the second (and
all the intervening steps between), but also distort the second image
to the first image.

When you have the two sequences, you then color blend the pairs of
images (each distorted to the same points) so that you not only have a
the images being spatially distorted, but also color blending from on
to the other.

At this time the IM -distort operator only has one method that can
distort ANY NUMBER OF POINTS.  And that is 'shepherds' method.  I have
yet to implement gridding and triangulation mesh distortion methods,
though I do want to add them.

WARNING; Shepards will not string rotating distortions.

Fred's script pre-dates (and helped develop) that distortion, as is
basically a shepherds distortion, with only ONE moving control point,
and four fixed control points in the corners (which simplifies the
maths enormously).

Also he makes the morph processing even simpler by generating the
distortions as a displacement map (Shepherds method is a displacement
distortion).  (I have notes on this but again the example is not online
yet)

This means he only calculates the distortion ONCE for each direction,
for each X and Y mappings (4 maps total), and varies the displacement
vector to do linear spatial distortion for each of the intervening
steps.  This is an enormous speed improvement, but only works for
images that distort in straight lines (linearly) between the two images.


  Anthony Thyssen ( System Programmer )    <[email protected]>
 -----------------------------------------------------------------------------
  "I would have been long since dead and gone, if I hadn't died."
                        - Jolie the ghost -- "And Eternity" - Piers Anthony
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/

_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to