Halaman

Rabu, 15 Juli 2009

Morphing Technic, Transform An Object Into Another

Article Focus:
Morphing is a distinctive effect that is best known from the movie "Terminator 2" as well as the Michael Jackson music video "Black and White". In this tutorial, Chris Zwar demonstrates simple morphs with the Reshape filter in Adobe After Effects 5.5 -- which is a Production Bundle only effect found under the "Distort" menu. (Intermediate to Advanced)


Download Movie Project files .sit Project files: .zip


---Introduction---

Morphing is a distinctive effect that is best known from the movie Terminator 2 as well as the Michael Jackson music video Black and White. After Effects can do simple morphs with the Reshape filter - which is a Production Bundle only effect found under the Distort menu. Basically, a morph consists of one image changing its shape over time until it becomes another image. Morphing can be used as a visual effect - for example an actor may morph into an alien - or as an invisible technique - for example to change the perspective of a miniature so it can be composited more accurately with live action.

The morphing effects in Terminator 2 were sophisticated 3D models which altered their geometry in 3D space, and there is no way to achieve that level of sophistication in After Effects. However, simple morphing with 2D images is fairly straightforward, and if you're familiar with basic After Effects procedures they can be completed fairly quickly.

A simple morph effect is actually three events happening concurrently:

  1. The shape of the original image (the "source") is warped over time to become the same shape as the final image (the "destination")

  2. The final image (the "destination") begins warped to match the "source" image, and it un-distorts over time until it resumes its normal shape.

  3. The opacity of the layers changes over time, so the destination image becomes visible over the source image as they are both distorting.

If you are planning to shoot footage for a morph effect then the subjects should be shot greenscreen so they can be isolated on a transparent background. During a morph effect, the shape of the image is being altered. Unless the subject is isolated then elements in the background can also be distorted and warped which will undermine the appearance of the overall effect. While the Reshape effect can be limited to certain parts of your image by using a "boundary mask" (see below), it is still much easier if your subjects begin as keyed elements. Once the final morph is completed, then the rendered effect can be composited into a background plate.

A really good morph will have source and destination images which are similar - not only in subject matter but also in composition. A morph of one actor into another will be much more effective if they both have the same stance and position in frame. Wildly different images will almost certainly give poor results.

To demonstrate this process, we'll do a simple morph of a human into a sheep - I already had some greenscreen footage of a sheep from a TVC, and Jock (the editor from downstairs) volunteered to help before he knew what it was for.

To make the morphing process as easy as possible, I prepared the source and destination footage so they would be as similar as possible. I keyed both elements, positioned them in frame so they occupied that same area of the screen, and used time-remapping so that their actions (turning their heads) matched as closely as possible. By using greenscreen source images, it is much easier to change the position and size of one subject to match another, because we don't have to worry about the background.


---The Tutorial---

In order to minimize file sizes for the Internet, the source footage files were rendered with separate alpha channels. You will need to re-combine these in After Effects before beginning the tutorial – applying the alpha channel movie as a luma track matte for the respective footage file. You could continue the tutorial using these as precompositions, but for simplicity I recommend rendering them out as uncompressed Quicktimes. A project file to do this for you has been included as part of the tutorial.

Begin by opening After Effects and importing the two Quicktime files: Jock-Source.mov and Sheep-Source.mov.(Download all the footage with the project file above in the green bar.)

In the project window, drag one of the footage items onto the composition icon at the bottom of the window, so it creates a new composition at the same size and frame rate as the source file. The composition should be 320 x 320, square pixels at 25 fps.

Change the composition settings to have a duration of six seconds, and then drag the other footage file into the composition. I called the composition "Reshape-Morph project"



Arrange the footage items so that the bottom layer is Jock, beginning at frame 0, and the top layer is the Sheep, starting at the three-second mark. There should be a one-second overlap, which is where the effect will take place. To make things simpler, split the Jock layer at the 3:00 point, then go to the four second mark (4:00) and split the Sheep layer, so our effect can be applied to layers only as long as it's used. From this point on, when I refer to the “Jock layer” and the “Sheep layer” I am referring to the one-second layers, and not the other, longer clips.


Click on graphic to view larger image.

The first step in creating our morph effect is to create a mask around our object. Turn off the sheep layer and go to the 3-second mark where the Jock layer begins.

If you select the Jock layer in the timeline, pressing "i" will take you to the in-point. Using the pen tool, draw a mask around Jock and make sure it's closed. I find that it's easier to draw a mask when the image is greyscale, so I click on the green button at the bottom of the composition window so I'm only looking at the green channel. You may also find it easier if you zoom in to 200% or even more.


Because Jock moves during the one second, we need to animate the shape of the mask to match his movement. Press "m" to reveal the mask properties in the timeline window, and click on the stopwatch. This will add a keyframe which records the shape of the mask at the 3:00 point.

It's important to note that we only need masks to define the shapes we're going to morph - we don't need our masks to act as masks which cut out the background. So where it says “add”, select "none" from the mask menu to turn off the mask, otherwise we will be clipping fine detail from the edge of Jock's face. Clicking on the name of the mask – which by default is “Mask 1” and then pressing "enter" will allow you to rename the mask to avoid confusion later, so call it "Jock shape".


Press the "o" key to go to the out-point of the Jock layer, which is 3:24. Using the selection tool, adjust the mask to match Jock's position in this frame. He hasn't moved very much and it's really only the profile of his face which needs to be changed. After Effects will automatically add another keyframe for the new mask shape, and it will animate the shape over time.

If you scrub in the timeline, you will see that as the mask animates over the one-second period, it matches Jock pretty well. We don't need to adjust the mask any further.

The next step is to do the same thing for the sheep layer. Draw a closed mask around the sheep, enable mask animation with a keyframe at 3:00 and then move to 3:24 and adjust the mask to match.


Unlike Jock, the mask with only two keyframes doesn't fit the sheep that accurately as it animates, so at 3:10 and 3:20 you will need to tweak the shape of the mask to match the sheep's movement. Rename the mask to "Sheep Shape" and ensure the mask mode is “none” and not “add”.


Once we have masks which outline our two subjects and animate over time to match their movement, we can begin on the actual morph effect.

Copy and paste each mask onto the other layer, so that both our layers have both masks. Rename the layers once you've pasted them (they default back to “Mask 2”) and turn them off by selecting "none" from the mask menu.


In the composition window, you should now see the shapes of the two masks overlapping our footage items.

Turn off the visibility of the sheep layer, select the Jock layer and apply the Reshape effect from the "Distort menu".

The first thing we need to do is change the defaults. Change the "source mask" to "Jock Shape". This is our starting point - we are defining which parts of the image we want to morph.

Change the "destination mask" to "Sheep Shape" - we want everything that is inside the “Jock Shape” mask – namely Jock – to be warped into the shape defined by the Sheep Shape mask. Change the boundary mask to "none" - this can be used to confine the area which is effected by the Reshape effect, but because our footage is on a keyed background we don't need to use it. If you use the Reshape effect on images which are not keyed, you may need to add a boundary mask to prevent the background from becoming distorted by the Reshape effect.

The "percent" slide is what we animate to control the morph - and if you experiment by sliding it you will see that we can make Jock look remarkably interesting.


However, at 100% Jock doesn't look as good as he could. This brings us to the most critical aspect of a good morph - correspondence points.

For our morph effect to look great, we want Jock's features to match the Sheep's as much as possible during the transition. We need to tell After Effects which part of Jock will become which part of the Sheep. To do this, we will use "correspondence points" to tell After Effects which parts of the mask around Jock correspond to the mask around the sheep. By default, applying the Reshape effect only gives us one pair of correspondence points, but for a shape this complex we will be needing between 20 and 30 pairs to make our morph look really good.

The quality of the final morph effect depends much more on the accuracy of the correspondence points than the accuracy of the masks.

Adding correspondence points is quite slow, but we can make it easier on ourselves by taking some preliminary actions.

Firstly, we can turn the Reshape effect off by clicking the "f" in the effect window. We don't actually need the effect turned on in order to alter its settings. Secondly, we can turn the layer's visibility off - again, we don't need to see the actual image.

In the “view options” settings under the view menu, turn off the visibility of masks - as we adjust the Reshape filter After Effects will show us the outlines anyway and turning off the masks will aid visibility.

And finally, because the correspondence vectors are black, change the background colour of the composition to grey. None of these steps effect the final morph, they are simply steps which make using After Effects more efficient.

In order to add correspondence points, we need to select the Reshape filter in the effects window. Even though the filter is turned off, selecting it will allow us to adjust it.

In the composition window, we can now see that our two outlines are different colours - red for the source shape and yellow for the destination. The squares on the mask are our first set of correspondence points - and the line indicates the direction that the source shape will take when being warped into the destination shape.

To add a new correspondence point, you need to hold down the "option" key (on a Mac) ("Alt" for Windows) while holding the pointer over one of the outlines. The mouse pointer will change to a pen with a "+" and when you click on the mask outline, a new pair of correspondence points is added. This is pretty slow. When you hold the mouse pointer over a correspondence point, it will change to four arrows to indicate that you can slide the point around the mask into a new position.


Begin with parts of the outline which obviously correspond between Jock and the sheep - for example his chin and his nose. Hold down the "option" key, add correspondence points and slide them into position. You will probably find that After Effects initially has some pretty strange ideas about where correspondence points should go, but just slide them where you think is best. Keep going until you've got the whole shape covered.


Check that your points don't cross, or the image will be twisted.

The outcome of the effect is highly dependent on correspondence points - especially the direction of the vectors. Even small changes to the position of two points can have a very big impact on the outcome.


The fact that the correspondence points are square indicates that After Effects is using linear interpolation to animate them over time.

We can alter this default setting to "smooth" to create a more organic transition. To do this, hold the mouse pointer over a correspondence point and hold down the shift key. Clicking on the point will change it to a circle, indicating that it will now be smoothly interpolated over time.

Work your way around the outline of the shape and change the keyframes to smooth.

When you're finished, you can turn on the visibility of the layer to see how your effect is coming along.

You may wish to adjust the positioning of some of the correspondence points to match features visible in the image. If you turn the Reshape effect on, and set the percent to "100", you can see how Jock is warped to fit the shape of the sheep.


Again, you may wish to adjust the correspondence points if you're not happy with the result. Remember that if you de-select the effect so that you can see the image clearly, you will need to re-select the Reshape effect in the effects window before you can continue to edit the correspondence points.

Set keyframes for the "percent" slider from 0% at 3:00 to 100% at 3:24. This will animate Jock over time so he warps from being himself, into the shape of the sheep.

Click on graphic to view larger image.

Preview the animation, and tweak the position of your correspondence points until you're happy with the effect.

Now we have to do the same for our sheep layer. It is possible to copy and paste the Reshape effect from the Jock layer, but be warned that the correspondence points don't always paste accurately, so usually it's quicker to begin from scratch.

Apply the Reshape effect to the sheep layer and change the Source shape to Sheep Shape, the destination to Jock Shape, and the boundary mask to none.

It's important to realize what we're doing here. The sheep begins as Jock and un-warps back to its original shape. So while Jock animates from a 0% effect to a 100% effect, our sheep layer is doing the opposite - it is animating from a 100% effect (warped into Jock) back to 0%.

As we did with the Jock layer, add correspondence points around the two shapes (by holding down the option key), change them to smooth interpolation (by holding down the shift key), and adjust their position to match corresponding features (by sliding them around the masks). At any time you can turn on the layer visibility and the effect to check your progress, but it's pretty slow.

When you're happy with the results, add keyframes to the Reshape effect so the Sheep warps from 100% (at 3:00) to 0% (at 3:24).

Click on graphic to view larger image.

This is actually as much as we have to do in terms of our Reshape effect. From here on, we're animating the opacity of the layers.

It is easier and certainly faster for us to render out our two layers as separate movies, and continue working on the rendered layers.

In the Reshape effect window, the "elasticity" pop-up determines the quality of the render, at the cost of speed. For the rendering, I chose "loose", but if you have a lot of time on your hands then there's no reason not to use "super fluid". At lower settings, the warped areas can appear pixilated and blocky, although renders are faster. Despite the descriptive nature of terms such as "loose" and "liquid", there isn't a stylistic difference between the different settings - it's the same algorithm just with different levels of precision. Each setting takes approximately twice as long to render as the previous setting.

Set your work area to the duration of the morph - in at 3:00 and out at 3:24. Firstly, turn off the visibility of the sheep layer and only render out the Jock effect, and then turn off the Jock layer and only render the Sheep effect - with the render-settings set to the work area only. I called them “morph components”.

Import both of these files back into the project.

Our current composition contains the Reshape effect, which does the actual warping of the images. We now have two Quicktime movies - one is of Jock being warped into the shape of a Sheep, and the other is of a Sheep un-warping from its initial shape of Jock.

The transition between these two effects is just as critical to the overall effectiveness of the morph. You can do a simple dissolve by only animating the opacity, but the effect can be made much more dramatic by using transitions like ripple dissolves or even FE Light Wipe (if you have it).

To simplify things, we'll set up another composition just to do the transition. In the Project window, select our current composition and duplicate it. Change the name of the duplicate composition to "Reshape - Morph Transition".

Open the Composition and delete the middle two layers which have the Reshape effect applied. Go to the 3:00 mark and drag in our two newly rendered footage files to fill the resulting gap. Put the sheep layer above Jock.

Basically you're re-creating your composition but using the rendered files instead of layers with masks and effects applied.

To reveal the morph, you can use any transition effect you like, but in this case we'll use a gradient wipe so that the luminance of our sheep layer will control the change in opacity. It looks good and enhances the warping effect.

Select the sheep layer and apply the “Gradient Wipe” effect from the Transition menu. In the "gradient layer" pop-up menu, select the second sheep layer- which is the one we've just applied the effect to. This makes the opacity of the sheep layer follow the luminance of the image over the duration of the morph effect. Set the "transition softness" to 50%, or whatever value you prefer.

The effect will animate from 100% at the 3:00 mark to 0% at 3:24 - add keyframes appropriately.

Click on graphic to view larger image.

Because Jock ends up being the same shape as the sheep, the sheep obscures Jock completely by the 100% mark and so we don't need to alter the opacity of the Jock layer at all.

Do a RAM preview to check the transition and tweak to your liking. You might want to "easy ease" or manually adjust the timing of the transition, but otherwise, that's it.


---Suggestions for Advanced Morphing---


What we've just done is a very simple morph, but even in After Effects there are ways to get more dramatic and “high end” results.

In our case, we have defined Jock and the Sheep (that's a good name for a Cop show) by a single mask. Their entire heads and bodies morph together, as a single image.

The next step into making this a more complicated looking effect would be to use our current project as a base, and build up more layers to deal with each feature of their faces. In this way, you could have another pair of layers which only mask their eyes, and other for their ears, and another that might just deal with their noses. In this way, you could build up a complicated effect where Jock’s eye morphs into the Sheep’s eye, his ear becomes the Sheep’s ear, and his nose becomes the Sheep’s nose. You would also be able to individually tailor the rate of change of each of these elements by adjusting the velocity curves of the “percent” slider so each element warps at a different rate.

It all depends on how much patience you have.


---Chris Zwar

source