Winmorph User's Guide

What is morphing ?

Getting started.

Creating a morphmesh.

Animation.

Windows

Morphing window

Animation window

Creating a new animation.

Morphing

Morphing testpictures.

Morphing a whole animation.

Warping.

Saving the animation.

Displaying the animation.

FLI

MPEG

AVI

Configuring WinMorph.

About WinMorph.

Bugs.(?!?)


Creating a morphmesh.

Loading a morphmesh.

Creating a new morphmesh.

Editing a morphmesh.

EditWindows.

Loading a picture.

Clearing the background.

Selecting a frame to be edited.

Editing points.

Adding a new point.

Selecting a point.

Moving a point.

Deleting a point.

Editing triangles.

Adding a new triangle.

Moving a triangle.

Deleting a triangle.

Playing the morph.

Generating frames by interpolation.

Stretching the framesize.

Saving the morphmesh.


What is morphing ?

Morphing means tranforming one form into another. When this form is a three-dimensional polygonmesh, like the T2000 in the film "Terminator 2", the morphing is referred as 3d-morphing. Another type of morphing, which you have seen for instance in Michael Jackson's musicvideo "Black or white", is done with pictures. Because pictures have only two dimensions, this kind of morphing is called 2d-morphing. 2d-morphing has become very popular in commercials.

Despite 3d-morphing has one dimension more compared to 2d-morphing, they both function similarly. In both of them, every point in the starting form's surface should have a corresponding point in the final form's surface and vice versa. In another words there should be a bijection between the surfaces of the two forms.

Usually the bijection is achieved by dividing the forms into polygons. Each polygon then has a relation to one and only one polygon of the other form. This kind of relation requires that the starting form equals the final form in number of polygons. Eachpolygon of the starting form is then gradually tranformed into its related polygon of the final form. This transformation changes both the shape and the color of the polygon.

How does WinMorph work ?

WinMorph creates only 2d-morphings. In morphing it uses triangles to approximate a correspondance between the starting picture and the final picture. Triangles are easier to handle than n-sided polygons and I don't know if it's even possibly to morph with n-sided polygons.

Winmorph also does image warping. In warping the pictures don't get mixed, only the first picture is used. The program still requires you to load the final picture, sorry about that.


Getting started.

You should now be in Windows to be able to run WinMorph while reading this document.

You'll also need the Girlchta sample files.

- Click on the starting window and select on the menu File|Open Picture

- Load the file girl.bmp

- Click on the final window and select File|Open Picture

- Load the file cheeta.bmp

- Select File|Open and load the morphfile Girlchta.mrf

Now the morphfile is loaded and it's shown in both start and final windows.

- Click on ToolBoxes 'single frame'-editbox and type number 7.

The 'single frame'-editbox is the clear space between the '<'- and '>'- buttons.

- Press the 'Morph'-button

Now WinMorph starts the morphing. You can see the results in Morphing

window. You can size and move the window if you want too see it better.

With 320x200 picturesize the morphing takes about 56s in my 386/33.

You can stop the morphing with ToolBoxes Stop-command.

As you can see, the Morph-command in ToolBox morphs only single frames.

If you want to morph all the frames , you should do the following:

- Select Animator|Morph From..To on the menu and press Ok.

Now the program starts morphing the whole animation.The morphing takes

about fifteen minutes, so be patient and watch the girl slowly turning into a tiger.

- Save the animation with File| Animation Save as Girlchta.tga.

- Go to Dos

- Go into directory where you saved your animation.

- If you have Dmpeg and Cmpeg, you can convert the TGA-files into MPEG-animation by

typing :  CMPEG -t0 ipb.ctl  girlc%03d.tga girlchta.mpg

and to watch the animation : DMPEG girlchta.mpg

- If you prefer FLI-animations instead of MPEG, you'll need aaplay.exe and dta.exe.

Aaplay is AutoDesks PD-program for viewing the FLI-animatiofiles.

Dta means Dave's Targa Animation and it's used for converting

the targa picturefiles into FLI-animationfile. It's shareware.

(You should use version 1.6 because version 1.8 leaves the frames

sometimes uncompressed and my fli-viewers didn't like it. )

- type : DTA /FFgirlchta.fli girlc*.tga

This assumes that dta.exe is somewhere on your directory path.

You should try to look for a switch to force DTA to compress the files.

It takes a while to map the colors and create the animation.

- now type : AAPLAY GIRLCHTA.FLI and get impressed

- Now you can delete the TGA-files, they are no longer needed.


Loading a morphmesh.

You can load a morphmesh by selecting a menucommand File|Open.


Creating a new morphmesh.

You can create a new morphmesh by selecting File|New. Winmorph then asks you how many frames you want in your morph. Usually adequate number of frames is between 30 and 60. I used 60 frames in my demos.


EditWindows.


Loading a picture.

To load a picture to an active editing window, select File|Open Picture from the menu.


Clearing the background.

If you have a previously loaded background and you don't want it any more, you can clear it with File|Clear Background. You don't need backgrounds if your morphmesh covers the whole picture area or if you want the background to be black.


Selecting a frame to be edited.

You can edit only one frame at a time in a window. The number of the selected frame is shown in the windowtitle of the editwindow. The framenumber can be decreased or increased with ToolBoxes '<' - and '>' - commands. You can also set the framenumber directly by typing the it in ToolBoxes 'single frame'- editbox and then pressing the 'Set Frame'- button.


Editing points.

Points connect triangles to each other.


Adding a new point.

If you push the right mousebutton and there aren't any points under the pointer, a new one is created. The point is placed in the same place in all frames.


Selecting a point.

To select a point you have to place the pointer on it and press the left mousebutton.


Moving a point.

To move a point you simply drag it to it's new place.


Deleting a point.

Select the point and press 'Delete'-key.


Editing triangles.

The triangles don't have to cover the whole picture.Where there are holes, WinMorph just leaves them as is or copies the background into them, if the backgroundpicture is loaded.


Adding a new triangle.

Press the right mousebutton on a point you want to be in the triangle. The point gets crosschecked. Do the same to other two points and you get a triangle. To remove a checkmark from a point just press the right mousebutton on it again.


Moving a triangle.

To move a triangle you have to move it's points.


Deleting a triangle.

To delete a triangle, select one of it's points and press 'Delete'.


Playing the morph.

By playing the morph you can check if there are any errors in the movement of the points. The playing shows a sequence of frames like in an animation.The start and end frames are entered in ToolBoxes 'To'- and 'From'- editboxes. Pressing the 'Stop'-button stops the playing.


Generating frames by interpolation.

Easiest way to design a morph is by designing the first and the last frame and generating all the other frames between them by interpolating. Interpolating is done by entering the two frames to be interpolated by in the ToolBoxes 'To'- and 'From'- editboxes. Pushing the 'Interpolate'-button starts the interpolation.

WinMorph allows you to design every frame individually. This is useful feature when the path of a point is not straight. It increses the workload but the designing becomes more flexible. You can move the point in a middleframe and then interpolate from the first to the middleframe and from the middleframe to the last frame.


Stretching the framesize

Sometimes you'll discover after you have finished designing the morphmesh that there are too few frames for a decent animation. This can be corrected with Animation|Stretch framesize. With it you can select a new framesize without having to create a new morphmesh. This function automatically interpolates old points to the new mesh.


Saving the morph.

To save a morphmesh select the menucommand File|Save or File|Save As.


Windows

When you start morphing you'll see the morphing in progress in the Morphing window. After the Morphing window has finished onn frame it gives the picture to the Animation window. Animation window stores it to the right frame and shows the picture.

Morphing window

Animation window


Morphing window

The morphing will be showed in the morphing window. The window is updated allways when a triangle has been morphed.

The morphing window is like the other picture windows but it doesn't have any commands relating to frames.

If you don't have a truecolor display the updating takes the same time as the morphing. When the picture has been finished and transferred to the animation window it may have to be scaled again. You can speed up the morphing by giving the same viewing resolution to the animation and the morphing window and therefore preventing the additional scaling.

The slowest Winmorph is when both the animation window and the morphing window are open and they have different viewing resolutions. For one area morphed there will be two areas updated. The fastest morphing is of cource achieved by closing the animation and morphing windows.

From the following results you can see how long it takes to show the pictures while morphing. The test was made with my 386/33 with 8 megabytes memory and 256-color display. The test morphmesh was Girlchta with 320*200 resolution. The viewing resolution was also 320*200.

Test case	All frames	seconds/frame

WinMorph version 1.35

Both windows open	14:56	59.7s

Animation window open	5:35	22.3s

WinMorph version 1.51

Both windows open

Fast mapping	5:23	21.5s

Gray scale	5:42	22.8s

Floyd-Steinberg	5:33	22.2s

Only animation window open

Floyd-Steinberg	5:14	20.9s

Both windows closed	2:32	10.1s


Animation window

The animation window acts just like the editing windows. You can select the frames of the animation like you were selecting the frames of the morphmesh. All the frame selecting commands of the editing windows work on the animation window as well. You can for instance watch the animation with the 'Play'-button. The configuration command in Config|Window works also.

One aspect of the animation window must be brought to attention.When you select a new resolution for the animation window all pictures of the animation must also be rezoomed. However, they are not zoomed all at once, only when they are showed in the window. This way it's easier to experiment with the different viewing resolutions because it could take ages to rezoom the pictures. If you want to rezoom the pictures, you can use the 'Play'-command the cycle through the pictures.


Creating a new animation.

A new animation must be created with File|Animation New if you want to change the animations resolution or to clear the animation. Winmorph then asks you the resolution for the new animation. The number of frames is the same as in morphmesh.


Morphing testpictures.

When you want to test your morphmesh , you can morph only selected frames. In ToolBox, there's is a 'Morph'-button, which renders only the frame entered in 'single frame'- editbox. If you want to morph a series of frames, use the Animator|Morph From..To-command in the menu. The morphing can be stops with the 'Stop'-button.


Morphing a whole animation.

Having finished designing the morph, you can start morphing all the frames. Select Animator|Morph From..To from the menu. You can stop the morphing by pressing the 'Stop'-button.


Warping.

Warping uses only starting picture instead of mixing two pictures. In other ways it's similar to morphing. I added this feature to WinMorph because it was so easy to implement. All commands for warping have a corresponding command in morphing, so in order  to do warping look instructions for morphing and select always 'Warp' instead of 'Morph'.


Saving the animation

After you have morphed the frames of your animation you'll have to save it for further uses with menucommands File|Animation Save or File|Animation Save As. The differences of these two commands should be farely obvious.

Winmorph can't save the animation to any existing fileformats. The animations are saved as a serie of ordered truecolor pictures. The fileformat for pictures is either Targa- or Windows BMP-format. The name of the file is truncated to five characters and with the last three numbers the pictures are kept in order.


Displaying the animation.

WinMorph only generates a serie of truecolor TGA-files. You have to use some other program to convert them to one of the animationfiletypes. You will also need a program to view the resulting file. In the following I have listed some animation fileformats. Feel free to use any of them.

FLI

This filetype is used by Autodesk Animator and it's the most common one. Autodesk provides a public domain FLI-viewer Aaplay. It can handle only 320x200 animations. There's also a Windows-version called Waaplay capable of playing bigger FLIs.

There's a shareware FLI-maker named DTA. DTA comes from Dave's Targa Animation. Version 1.6 converted my animations without flaws but the version 1.8 leaves the pictures uncompressed if there is no gain in compressing. However, it seems that the resulting FLIs are not compatible with AutoDesks FLIs.

MPEG

Previously I didn't care much for this fileformat but then I got the excellent MPEG-codec from Stefan Eckart. Both decoder and encoder should be found in Winmorph's home site. The MPEG-format is getting such an importance that for now on I only use MPEG in demo files. Animations are in truecolor but still they are significantly smaller than for example FLI's.

AVI

This animationformat is used by Video for Windows.


Configuring WinMorph.

In the following I have listed the possibilities to configure WinMorph the way you like it.All commands can be found at Config submenu. Commands affecting individul windows change only active window.

Configuring the windows.

Stretching picture to the window.

Viewmaps.

The size of the points.

Changing the colors.


Stretching picture to the window.

WinMorph can show pictures in two modes. The picture can be stretched into window or it can be shown with the  scrollers.

When WinMorph is in Stretch To Window-mode, picture is resized every time the size of the window is changed. If you want to zoom in the picture, simply drag the window bigger. No scrollers are needed because the whole picture is visible

If stretch-mode is not selected Winmorph uses zooming resolution set in Config|Window as a viewing resolution. If the resolution is larger than the window size, the window uses scrollers.


Viewmaps.

WinMorph uses additional bitmaps,viewmaps, to store the zoomed picture. This is done to speed up the repainting of the window. Normally the zooming and the conversion to screen is done always when the window is repainted and therefore it takes time. This can be prevented with viewmaps. If the picture in windows changes the picture is repainted but it's not repainted to the window but to the viewmap. Whenever windows need repainting viewmaps are used instead of the actual picture. Disadvantage of viewmaps is they need some memory. If you have problems with the shortage of free memory, you can prevent WinMorph from using the viewmaps.

There are several different viewmap types to select. Propably you only need to use the Floyd-Steinberg dithering. I made the other viewmap types because they were rather easy to program.

Most of the viewmaps only have an effect when using truecolor pictures with a paletted display.If you have a truecolor display you probably are satisfied with the speed of repainting and the colors of the windows. You can load both truecolor and paletted pictures but the actual morphing outputs only truecolor pictures. All truecolor pictures use uniform palette.

No Viewmap

Windows DDB

Fast mapping

Gray scale

Floyd-Steinberg


There's no viewmap used. Use this only if you don't have enough memory. Normal Windows painting functions are used.


Uses Device Dependent Bitmaps for fast repainting of the picture. Normal Windows functions are used which makes viewing truecolor pictures in paletted devices to be painfully slow.


Same as Windows DDB but the truecolor-palette conversion takes the advantage of uniform palette. This makes it considerably faster than the Windows counterpart.


Truecolor files are converted to gray scale. Nearly the same speed as with Fast Mapping.


Uses Floyd-Steinberg error diffusion dithering with two weights. Almost as fast as Fast mapping with a lot better picture quality making this my favorite.

The main point with dithering is it increases color accuracy in a cost of spatial accuracy.


The size of the points.

You can change the pointsize by selecting Config|Point Size. Useful pointsize is somewhere between 0 and 5.


Changing the colors.

You can change the colors of the points,triangles and selected points. All commands for changing the colors are in the menu under Config. This command is useful when your points vanish in the picture because they have the same color.


About WinMorph.

Registering.

Disclaimer.


Registering.

Winmorph v1.51 is shareware. You are allowed to copy it, distribute it, upload it to BBSs, and use it. You may not, however change or alter the files in any way.

If you find this program useful please send 20 US$ or 100 Fm to address shown below. Don't forget to inform me who you are.

Marko Marjamaa

Yliopistokatu 16 / 107

90570 Oulu

Finland

If you want to contact me via Internet, my Email address is

mama@phoenix.oulu.fi.

This archive should contain the following files:

WINMORPH.EXE

WINMORPH.HLP

WINMORPH.DOC

You also need Borlands DLLs for running the program. They can be found in Winmorphs home site.

BC30RTL.DLL	( DLLs for Borlands OWL-window library)

OWL31.DLL

TCLASS31.DLL

In phoenix.oulu.fi there are some example files that could help you understanding what morphing is all about.

MONDAY.ZIP	(Examples)

Monday.mrf	Marjo.bmp

Jari.bmp	Monday.mpg

GIRLCHTA.ZIP

Girlchta.mrf	Girl.bmp

Cheeta.bmp	Girlchta.mpg

T2.ZIP

T2.mrf	T2_arnold.bmp

T2_robot.bmp	T2.mpg

If any of these files are missing, then you have an incomplete copy of WinMorph 1.51 and should contact the author to receive a full copy.


Disclaimer.

WinMorph v1.51 is supplied as is.  The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of WinMorph v1.51


Bugs.(?!?)

- When you have entered a number in ToolBoxes editboxes, it is the active child. Still according to it's titlebar it isn't active. If you try to zoom the editwindow, the message goes to ToolBox and nothing happens. In fact, all menucommands go via ToolBox.