Page 1 of 1

Shape morphing

Posted: 2008-05-16T14:03:35-07:00
by dognose
Image

I think it'd be neat to be able to do this w/ im. Are there any free programs that can do this?

Re: Shape morphing

Posted: 2008-06-03T19:50:00-07:00
by anthony
prehaps if you describe or example what you mean by "shape morphing" I can think of at least three things it could refer to!

Re: Shape morphing

Posted: 2008-06-13T10:13:46-07:00
by dognose
Sorry, could you not see my example image?

I want to morph one thing into another. Something beyond the "dissolving" method used now.

Re: Shape morphing

Posted: 2008-06-13T13:06:19-07:00
by fmw42
I don't think that IM can do that now. But it would be interesting to know how you generated your example or where you got it. I think what is being asked is what the technique was that was used. Control points were picked? How were they interpolated? etc.


There are other programs out there is you just search the Internet. For example, see the External Links on http://en.wikipedia.org/wiki/Morphing

Re: Shape morphing

Posted: 2008-06-14T21:18:38-07:00
by anthony
Sorry no I did not see your example then, I can now. (UPDATE: example is now pointing to a 'contact webmaster' page)

What you are showing is true 'morphing' Specifically both spatial and color morphing.
What IM currently provides is purely a color or 'dissolved' morph.

HOWEVER. the new additions added for image distortions are working toward the ability to do proper spatial morphing as your example shows, as well as what you see in movies. But it still has a ways to go before it will reach that complexity.

Even if it does achieve this ability, you would still need to define 'register' lots of points which are to correspond to similar points in the final image.

In the mean time have a look on the net for Xmorph which is a free public domain package that is designed to specifically do this type of effect.

Re: Shape morphing

Posted: 2008-07-05T13:03:43-07:00
by fmw42
I have been working on a UNIX bash script using IM to do something like this using one control point (nose to nose) and the four fixed corners of the image. I borrowed your images for a test. Here is the result of my first cut at the script, not yet finalized with 20 frames including the two originals plus additional 18 frame reversal for a total of 38 frames. It took about 6min on my Mac mini 1.42GHz PPC.

Image

Re: Shape morphing

Posted: 2008-07-06T19:24:48-07:00
by fmw42
I just uploaded my script, shapemorph, to my web site. If anyone is interested, it can be downloaded at
http://www.fmwconcepts.com/imagemagick/index.html

Note that the script if very slow due to the extensive use of -fx.

Re: Shape morphing

Posted: 2012-02-21T15:05:12-07:00
by goldskif
Excellent script!!
Tell fmw42, and they can keep the images in the form of individual images, without merging?

Re: Shape morphing

Posted: 2012-02-21T16:23:35-07:00
by fmw42
goldskif wrote:Excellent script!!
Tell fmw42, and they can keep the images in the form of individual images, without merging?

Thanks about the script. But what do you mean by "they can keep the images in the form of individual images, without merging"? In what context is your comment?

Re: Shape morphing

Posted: 2012-02-21T21:57:25-07:00
by goldskif
Sorry, wrong translation (((.
It is desirable to save as a separate figure 0.png, 1 png, 2 png, ..... (or jpg, tiff....)
And have a custom -blend

Then this script is perfect as a commercial for photographers 3D

Re: Shape morphing

Posted: 2012-02-21T22:03:46-07:00
by fmw42
goldskif wrote:Sorry, wrong translation (((.
It is desirable to save as a separate figure 0.png, 1 png, 2 png, ..... (or jpg, tiff....)
And have a custom -blend

Then this script is perfect as a commercial for photographers 3D

You can always separate the animated output into individual images

convert animation.gif +adjoin figure_%d.tiff

PNG and JPG do not require +adjoin as they do not allow multi-frame images as do gif and tiff

What do you mean by custom blend? Each frame is a weighted blend of the two input images. The weight of each image is determined by what the frame number is. That is in addition to the shape distortion (inverse distance weighted -- Shepard's method). So it is morphing both shape and color between the two images.

At some point in the future, I might try to extend the morphing to allow multiple points. But that would be better done when IM gets some kind of triangular mesh interpolation. Right now the interpolation is done using Shepard's inverse distance weighted averaging.

Re: Shape morphing

Posted: 2012-02-21T22:25:42-07:00
by goldskif
I need two photos to make a 10 and keep everything as jpg, png ..
Then cut them into strips.

Re: Shape morphing

Posted: 2012-02-22T10:35:50-07:00
by fmw42
goldskif wrote:I need two photos to make a 10 and keep everything as jpg, png ..
Then cut them into strips.
Sorry, I don't understand. Are you asking for a morph from two images to generate 10 frames and then interleave them to the lenticular format. If so, just process the morph image and process into the lenticular image using -sample and my interleave script as described in viewtopic.php?f=1&t=20357&start=15#p81197

Re: Shape morphing

Posted: 2012-03-14T18:59:36-07:00
by fmw42
I just uploaded a new shapemorph2 script that allows any number of control points. see link below.