About Warping Previous Next 2D Transforms

Chapter 14, Warping
Warp 2D



The Warp 2D tool lets you:

The basic operation of the Warp 2D tool involves drawing source and destination shapes and linking pairs of these together. The correspondence between points on the source and destination shapes defines constraints on the transformation of the image.

Another type of shape constraint is a fence shape which functions like a pair of source and destination shapes that are constrained to always be equal, keeping a part of the image from moving from its source position. The resulting transformation tries to make a deformation of 2D space that warps the image to satisfy the specified shape positions, while automatically repositioning the unconstrained parts of the image to make the overall warping as smooth as possible.

The types of shapes supported include those in the Garbage Mask and Remove Dust tool: Splines (open or closed), Rectangles, and Ellipses.

After drawing the shapes which define the transformation, you can set or animate an interpolation parameter which controls the amount of warping.To create a static warp of an image you will just set this to 1.Sometimes you may want the image to smoothly change from its original shape to a warped shape and will animate the interpolation parameter from 0 to 1.There is also a control to use a per-shape interpolation amount to have various features deform at different times.

Warping Workflow Top

The warping of a single image involves a multi-step process. You first work in source space (by viewing the input image by pressing the 5 hotkey while focused in the viewer) drawing several shapes which define the important features that will be deformed and the fence shapes which will lock parts of the image in place (like the dog's left eye down to its nose).

Show full-size image

You will thenswitch out of source space into destination space (by pressing the 6 hotkey while focused in the viewer) and begin editing the destination shapes.

Show full-size image

As you drag around a destination shape, the image underneath is warped accordingly.Once you have dragged all the destination shapes to their desired final positions, you may want to add another shape pair or fence shape to refine the warp. You will have to switch to source space to draw the starting position, then back to destination space to move the shape around and see the result.

Show full-size image

Warp 2D UI Top

The Warp 2D UI consists of three tabs: Shape Drawing, Output, and Options.

Show full-size image

Shape drawing closely mimics that of Garbage Mask and Remove Dust tools.The types of objects that can be created are:

Like the Garbage Mask, there is a list box with the named shapes and individually editable parameters. The Warp UI also has all the components of the Garbage Mask for transforming shapes, setting drawing options for rectangles and ellipses and for loading and saving user settings--see Garbage Mask Controls.

Each shape has a parameter which controls the smoothing across its boundaries, named Smoothing.For open shapes, this can have one of two values: None or Bidirectional.The setting None means that each side of the shape is smoothed independently and there can be discontinuities in the warp across the shape.The setting of Bidirectional means that smoothing is applied across the shape and there will be no discontinuity in this region.If the shape is closed, then in addition to these two values, there are two other possible values: Inside and Outside.A value of Outside means that the inside of the shape is smoothed independently of the outside, but the outside is smoothed to match the inside.A value of Inside is the opposite of this.

Show full-size image

Smoothing = None Smoothing = Bidirectional

Each shape also has a Boolean parameter, Fence.When this is enabled, this shape acts like a pair of source and destination shapes which are constrained to be equal.This holds the image under the shape in place.When the Fence parameter is enabled, the destination shape and link points disappear. Fence shapes are treated differently from regular shapes. Fence shapes have their own visibility, and the link lines and link editing manipulations do not apply because the correspondence is defined to be the identity along the curve.However, each shape has a toggle to determine if it is a Fence or not, so you can always change a fence shape back to a regular pair of shapes.

Note: When you create Fence shapes, you will usually want to set the Smoothing attribute of the Fence shape to None, to ensure that there is no motion crossing the border of the fence.

Each shape has an Interpolation parameter which is only relevant if the Timing mode is set to Shape (described in the Output tab section).Each shape also has a Mute switch to disable its effect on the warp, and a Lock switch that locks the points, shape, edges, and tangents of the shape.

You can change the name of a shape under the Name heading in the shape list. With the cursor in the text field, press F2, type in a new name and press Enter. You can also assign a name to a shape once you have selected what type of shape you want to draw. Under the Create Shape label, select the default shape name and type in a new one then press Enter or click outside the text field.

Show full-size image

  1. Source and Destination shapes
  1. Warp result

Show full-size image

  1. Fences added to limit warp to the right eye
  1. Warp result

The Warp 2D tool will have two outputs:

While editing, you can use the standard hotkeys (5 and 6) to switch between the input image and the second output, in order to view the source and destination spaces.

Shapes are displayed in the viewer with a color that depends on its type, e.g., source, destination, fence, links, or interpolated shapes.

Shape Color
Source Red
Destination Blue
Fence Green
Links Cyan
Interpolated Magenta

You can distinguish between and edit source and/or destination shapes by toggling on/off the visibility of each of the following classes of shapes:

Show full-size image

Show full-size image

Other controls on the Shape Drawing tab include:

Use: To:
Name Give the selected shape a name. Select the default name in the text field and type in a new name then either press Enter or click outside the text field to apply the name.
Interpolation Control how much warp is applied to the image--see Output Tab.
Fence Enable/disable the shape as a fence.
Smoothing Apply smoothing across the shape's boundaries.

You can also adjust control points of the shape using the same controls the Garbage Mask uses--see Editing Masks. You can also copy and paste a selected source or destination shape either in the same Warp 2D tool or from another.

To copy and paste a source or destination shape:
  1. Select a source or destination shape to copy.

  2. Use the Ctrl + C hotkey combination to copy the shape.

  3. Use Ctrl + V to paste the entire animation of the shape points and tangents.

    Note: The transform, and other properties are not copied.

Show full-size image

Curve Correspondence Top

In addition to the usual spline editing interactions, you can also edit the correspondence between two linked shapes.In the image below, red curves depict source shapes, blue curves depict destination shapes, and cyan lines represent the correspondence between the pairs of linked curves.These lines show the direction the warped image will move as the interpolation parameter is animated from 0 to 1. You can add link points on either curve (using the Ctrl key) which can then be dragged along the curve to change the directions of the lines.Adding a point on one curve will also create a corresponding point on the opposite curve.Dragging one of these points sideways along the curve will skew the correspondence directions.Correspondence positions are animatable.

Show full-size image

Output Tab Top

There are several parameters which control how the warped image is rendered and are located under the Warp label.

Show full-size image

Use: To:
Timing Set the timing of the deformation. The default state is Global where all shapes deform at the same time based on the interpolation you set (see below), or you can select the timing to be on a per shape basis allowing you to deform various features on differing schedules.
Interpolation Define how much of the warp is applied in the final rendering. A value of 0 means that the image is passed through unchanged. A value of 50 means that the image is deformed 50% of the distance toward the destination shapes.
Warp Invert Send the warp backwards. Used in the morphing workflow--see Morphing Between Two Images.

There are several parameters which control how the image warp transformation is computed and they are located under the Render label.

Show full-size image

Use: To:
Quality Control the quality versus speed of the deformation as higher quality warping takes more computation time. If you experience discontinuities or warps that are not smooth, or if the animation has regions that do not warp smoothly over time you should increase the Quality setting.

The warp of the image is computed to satisfy the constraints defined by the drawn shapes, and still be as smooth as possible. The choice of smoothing criteria is Rigid or Skew.

Use: To:
Smoothing Select the smoothing criteria; skew is a mode where the image transformation is locally constrained towards a 2D affine transformation, and the image is allowed to skew as it tries to find the smoothest warp. In Rigid mode, the image is locally constrained to an angle preserving similarity transformation where skew is discouraged but not impossible.

Show full-size image

  1. Skew
  1. Rigid

Use: To:
Boundary Set the image boundary to either Fixed or Free. Fixed holds the border of the image in place while Free lets the image expand beyond the image border.

Show full-size image

  1. Fixed
  1. Free

Like the Garbage Mask, the Warp 2D tool's Output tab contains a crop tool and user settings controls--see Output Tab Settings.

Show full-size image

Options Tab Top

The Options tab contains the same options and User Settings as the Garbage Mask Options tab--see Options Tab Settings, with the exception of the Links View parameter which allows you to change the spacing of the links between source and destination shapes.

Show full-size image

Links spacing = 30 Links spacing = 3

Morphing Between Two Images Top

Although the Warp 2D tool warps a single image, you can morph between two images using the following workflow:

To warp between two images:
  1. Add a Warp 2D tool node to image A.

  2. Place all your source shapes onto image A.

  3. Change the viewer to be viewing image B using a context point, and align all the destination shapes on the corresponding features of image B.

  4. Animate the Warp from 0 to 1 interpolation, which warps image A toward B.

  5. Copy the Warp tool, select the Invert-Warp button and connect Image B as its input.This will warp Image B backwards towards A.

  6. Add a Blend tool node between the two warp outputs and animate it from 0 to 1.

Previous Next