Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Paul Nettle, posted on February 03, 2001

Image Description, by Paul Nettle

A long time ago I wrote a shareware program called CMorph ("The Complete Morph"). CMorph was a two-dimensional morphing program that used the same exact techniques that were used in the special effects of some popular movies. I recently released the source code on the Fluid Studios publications page.

In the image above, the top two images are the inputs, and the bottom two images are a couple frames from the output animation.

Some links:
  • This morph animation can be found here. You'll need QuickTime or some other player that can handle FLC files. Even by today's standards, I think this one holds up.
  • The DOS binaries can be found here.
  • And the source is available here.

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
Lion V

February 03, 2001, 03:00 AM

Disturbing.... :-)
From the 2 frames shown, it looks like its an overlay of the two images on one another, with some algorithims going on. to alter each image to look like the other.
Is this hypothosis correct ?
I`ve never looked into morphing at all.

Sylvain Rochette

February 03, 2001, 03:34 AM

That remind me a old demo on my old amiga 500/2000 made by Real something dont remember ;)


February 03, 2001, 03:56 AM

Lion V,

Yes, that's essentially what it is. Here's the process more accurately stated:

A grid mesh (usually non-linear, like bicubic, catmul, etc.) is chosen for each image (source & dest). The mesh for each image is manipulated to hilight the features of each image. Note that both image meshes have the same number of vertices, so they can be easily morphed (interpolated) from source to dest.

When manipulating the meshes for each image, it's important to align key hilights of one image to key hilights of the other image. For example, in the grid mesh, vertex [3,3] might be the center of the left eye of the girl. Properly setting up the meshes means that you would need to place that same vertex (3,3) in the center of the tiger's left eye. Given that concept, let's take it a little further. The vetices mean very little, other than to control the shape of the curved mesh, so importance is really placed on "outlining" key features of each image, rather than placing vertices where they belong. This, combined with a good set of source/dest images (i.e. images with many similarities) are what make for a good morph.

The images are constrained by their mesh, so as the mesh changes shape, so does the image within (via filtering.) Note that not only is the mesh nonlinear, but so is the filtering. It's not bilinear or trilinear, but rather it follows a curve that is interpolated along each scanline of the image.

The actual process is a frame-by-frame morph of the source image's mesh "shape" to the destination mesh's shape. This "tweened" mesh is then used for both images -- they are both warped to fit this single tween mesh. This means that at the start of the morphing animation (closest to the source image's parameters), the destination image is radically warped. As the morph nears the final frame of the animation, the destination image is warped less, but the source image is the image being radically warped.

During this process, a crossfade takes place. This crossfade helps hide the artifacting you get from the "radical warping" near the start and end of the animation, because the image being most radically warped has the least amount of influence on the crossfade.

That might be a bit confusing, but that's the process. ;)

- MidNight


February 03, 2001, 05:39 AM

god :) i saw the thumbnail and said to myself, oh look, CMorph. :) that was a cool little program.


February 03, 2001, 06:56 AM

Whoooa!!!! This can't be true!
Definitely the koolest IOTD I've ever seen (max respect to everyone posting here)!

You don't know how much spare time I passed looking at this shot when I was younger
(I found it in a programmer's journal)....
This inspired me a lot and I started coding a 100% asm morpher on my old 486. :)
I came out with a realtime sinus morpher/warper, which unluckly I never used when I was a scener.

BTW great job, Paul. I was absolutely astonished by this spellbinding image.

Definitely I have to say thank you because if I'm still here writing code it's because I've seen
some stimulating images/techniques like this IOTD. As for me it's an important piece of my personal

Thank you again, Paul!


February 03, 2001, 10:59 AM

Heh, it's pretty kewl to see this pic here, I was playing around with CMorph a while ago, never thought I would meet the author of this program in (virtual) reality :). Feels almost like talking to a film star ROFL. Good work :))).


February 03, 2001, 11:02 AM

Here there, first I want to say that I really like your IOTD..
I have one litle question though

when looking at the output frames, I saw that it was a fadeover from the first input frame (woman) to a moved rotation of the second output frame (tiger or whatever).
My question is:
Does the program automatically more and rotates the second input frame to make layover nicely or have you done that yourself in a prog like photoshop?

When it is done automatically I think it is very freaking cool, otherwise it's just cool :-)


February 03, 2001, 01:01 PM

I understand most things about morphing except for the main thing:
(well, main except for crossfade)
how do you warp image based on new vertex positions? You interpolate the selected points, and then what? :) It isn't just texturemapping, is it? Because that wouldn't look very good, probably. What are your opinions?



February 03, 2001, 02:57 PM


Coincidentally I just wrote a morphing program for my computer graphics class. How long does each frame take to generate?



February 03, 2001, 09:11 PM

On my p2/450, about a second or less. I went for quality over speed. :)


February 03, 2001, 09:18 PM

It's kinda auotmated. You setup all the control points and the control mesh for each image, and the parameters....and it does the rest.


February 03, 2001, 09:32 PM

how do you warp image based on new vertex positions? You interpolate the selected points, and then what? :) It isn't just texturemapping, is it? Because that wouldn't look very good, probably. What are your opinions?

The points are the control points for the curved mesh. When you interpolate them, you generate a new curved mesh from them. The filtering (warping) process is kinda complicated because its entirely non-linear. Think of the curved mesh as a grid of boxes (with curved edges).

If it was linear, it would be the same as using polygons for each "grid box" within the mesh, and texturing those polygons with the portion of the image from that "grid box". Linear filtering would mean that you would see the edges where the "grid boxes" meet -- they would appear as seams in the image.

The source for this is in WARP.C from the public source distribution. You'll notice it's a two-pass process. It warps by X first (i.e. horizontally) and then by Y (i.e. vertically).


February 05, 2001, 11:40 AM

I d/l'd CMorph back in the good old days of BBSing and 386's. I had fun playing around with it, but never did anything other than goof off. Thanks for sharing the code!


February 06, 2001, 02:24 PM

Great this morphing stuff, but somehow the www as well as the ftp server of can't be reached by my computer...

This thread contains 14 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.