Clone Tool

Cloning is the process of painting small patches of one image over another (or itself). You can use cloning to retouch image defects such as dust specks and scratches, to remove unwanted image elements such as power lines and traffic signs, to fill in missing detail, to replicate parts of an image multiple times, or to copy part of one image to another.

The clone tool has two brushes. The first brush is the source brush and you start off by defining its initial position. The second brush is the target brush – dragging the target brush over the output image paints image data from the source brush location at the target brush location.

Once the brush parameters described below are set, you clone strokes on the output image by clicking and dragging. Unlike most other transformations, the clone tool works directly on the output image and not on the input image.

The clone tool records the dimensions of its input image internally. If you try to apply the same transformation to another image whose width and height in pixels does not match the original input image, an error is reported as it does not make sense to retouch two different size images the same way.

How Cloning Works

To use the clone tool, you start by setting the source point where you want image data to be taken from. Then you position the cursor where you want image data to be copied and click and drag to draw a stroke on the output image.

Setting the source point

To set the source point, shift click on the source image where want to clone from. The source brush may be located on the output image, in which case you will be copying from one part of the image to another. Or, the source brush can be placed on the input image or on some other image specified by the Source Image control.

Drawing Strokes

Cloning takes place at the target point on the output image. To clone a stroke, click and drag the cursor on the output image to paint over the area you want to cover up.

After you release the mouse button at the end of a stroke, you can reposition the source point if necessary by shift-clicking before starting a new stroke.

If you make a mistake, click the Undo button or type Ctrl-Z to erase the most recent stroke.

Source and Target Circles

A circle whose size corresponds to the brush radius is displayed at the source point and a second circle of the same size is displayed at the target point. So you can tell them apart, the source point is displayed with a small circle at its center while the target point has a +:

Cursor Linkage

There are four cursor linkage options which specify various relationships between the source point and the target point.

Linked cursors is the usual option -- this maintains a fixed offset between the source and target points, so they move together as you paint a stroke.

Another useful option is One to One which locks the source point to the target point. While this has no effect if the source and target images are the same, it is useful is if the source image is a modified version of the input image and the two images are the same size. In this case, One to One cloning lets you paint parts of one version over the other, a little like using a freehand mask to combine them. In the case of One to One cloning, it is unnecessary to shift-click to define the source point since its position in the source image is always identical to the target point’s position in the target image.

Other linkage options are described below and apply to special situations.

Amount

The amount control lets you scale back the overall transparency of the areas you have cloned or you can create a mask to restrict cloning to specific parts of the image. The amount setting applies equally to all the strokes you make and cannot be customized on a stroke-by-stroke basis.

Brush Settings

The following settings determine the brush properties:

Radius

This slider controls the brush radius in pixels. Smaller brushes are good for cloning fine details. Larger brushes are good for cloning big areas quickly. In addition to using the radius slider, you can also use the mouse scroll wheel to adjust the radius.

Transparency

This slider controls the brush transparency. The more transparent the brush, the more the background shows through.

Softness

This slider lets you control how soft the edges of the brush are. The softer the brush, the more smoothly its effects are blended with the original image.

Spacing

This slider lets you control the spacing interval at which the brush is applied as you drag. The smaller the spacing, the more the applications overlap. Too much overlap can lead to a heavier application of the brush than you intended, so you may need to increase the transparency. Too little overlap can leave gaps.

Fadeout

This slider lets you make the brush effect fade as you draw each stroke, effectively increasing its transparency the further you drag from the starting point.

Shape

 The brush shape tool bar has three options: round, square or diamond. Usually a round brush is fine, but occasionally a different brush shape helps you get into corners hard to reach with a round brush.

Stylus Pressure

Unless you are using a tablet with a pressure-sensitive stylus, this setting is ignored.

If you are using a pressure-sensitive stylus, this control lets you determine the effect, if any, that stylus pressure has on the current brush stroke.

Ignore -- stylus pressure has no effect.

Controls Opacity -- increasing stylus pressure reduces transparency, making the stroke more opaque.

Controls Radius -- increasing stylus pressure increases the brush radius, making it larger.

Controls Hardness -- increasing styles pressure reduces softness, making the edges of the brush harder.

Controls Flow -- increasing stylus pressure reduces spacing, causing the brush to be applied more often as you move the stylus.

 Undo/Redo

The Undo and Redo buttons let you erase or redraw clone operations, one stroke at a time. A stroke is defined as everything between pressing the mouse button and releasing it.

If the undo or redo button is grayed, it means there are no operations left to undo or redo. If you undo too many operations by accident, you can click the redo button until you get back to where you wanted to be. However, once you draw a new stroke, you can no longer redo past that point.

You can use the keyboard shortcuts Ctrl-Z for undo and Ctrl-Y for redo.

Source Image

By default, cloning is done between the output image and itself, however you can clone from one image to another, subject to the limitation that you cannot clone from a color image to a black and white image.

To clone from a new source image to the output image, first use the Source Image control to select the image. If the image you want to clone from is not already open, select Load… from the image menu to open the image. Once you pick an image, it will show up in the image browser as half-size thumbnail next to the Clone transformation.

To clone from a source image you have already established as an input, just click on its half-size thumbnail in the image browser to select it.

Once you pick a source image, the display switches to split screen with the source image on the left and the output image on the right. Shift-click on the source image to set the source point and then drag on the output image to apply the cloning brush.

To resume cloning from the output image to itself, click on the Clone thumbnail in the image browser. To clone from the input image or from some other image, click on its thumbnail in the image browser. Selecting the current input image as the source image is slightly different from cloning from the output image to itself since it always copies data from the unmodified input file while cloning from the output image to itself copies from the modified input image.

Mode

These settings control how the cloning operation is performed. Lighten Only just clones where the source image is lighter than the current image. Darken Only just clones where the source image is darker. Copy clones in both situations.

Brush

If you select Single, then a single brush application is performed when you click on an image and is not repeated as you move the cursor with the mouse button depressed. The default setting is Continuous which keeps cloning so long as you hold the mouse button down.

Cursors

These settings control how the source point moves as you move the target point.

Linked (the default option) means the offset between the two points remains fixed. This lets you clone large areas roughly with a large brush radius and then go back with a small brush to finish up the edges without worrying about any possible misalignment.

Repeat means the source point snaps back to its original location as soon as you release the mouse button. Use this option when you want to clone multiple copies of the same object.

One to One means the source point is locked to the target point. While this does nothing when cloning within a single image, it is can be useful when cloning from one version of an image to another version of the same image, since it eliminates any possible misalignment. For example, you can use any transformation to alter an image and then selectively clone back part of the original image.

Fixed means the source point stays in the same place once you set it even when you move the target point. This is like using one spot of an image as a brush.

Tiled

If you select Yes, if you move the source point beyond an edge of the source image it automatically wraps around to the other side. This is useful if you are cloning a seamless tile image as it effectively extends it out to infinity.

Overlapped

This setting only makes a difference if you are cloning from an image onto itself and the source and target areas overlap. If you select No, image data is cloned from the previous version of the image as it appeared when you completed your last stroke, if any. If you select Yes, image data is cloned from the output image. If you select Yes, the clone tool can feed back on itself and repeat parts of the image multiple times since it is copying copies of the source area over itself.

If you select No, this does not happen, and the cloned area is simply offset by the distance between the source and target points.

Brush Display

As a visual aid, a representation of the current brush is displayed at the bottom of the dialog box. This display illustrates the radius, transparency, shape and softness of the brush. If you select a very large brush radius, part of the brush may not be visible.

 Settings Menu

Saving a Clone settings file saves all the accumulated clone operations and the current brush settings. Reloading a previously saved Clone settings file resets the Clone transformation and then re-applies all the clone operations from the settings file to the current input image. Since this undoes any cloning you have done so far and since clone operations are specific to both the size and the contents of the input image, Clone settings files have limited utility. Creating a default Clone settings file is likely to cause warnings about file size mismatch every time you use the Clone tool, so this is not recommended.

In addition to the standard menu items, the settings menu lets you load or save the current brush settings (Radius, Transparency, Softness, Spacing, Fadeout, Shape, Mode, Brush, Cursors, Tiled and Overlapped). Brush settings can be shared with the Paint and Smudge tools. Settings unique to these other tools are set to default values when saved from the Clone transformation. You can also save the current brush settings as a default brush which is loaded whenever the Clone transformation starts up.

When saving Clone settings as default settings, no strokes are saved since it generally does not make sense to apply cloning from one image to another, especially if it has different dimensions.

 

Tips

You cannot clone a color image over a black and white image without first converting it to a color image. You can accomplish this conversion by running the image through the Convert transformation.

Keep your strokes short – that way if you accidentally clone over a spot you did not intend to cover you can undo it without having to redraw too much.

Try to use as few strokes as possible – overworking an area can muddy the image.

To fully or partially restore an area you have cloned over, select the input image as the source image and set Cursors to One to One.

The Lighten Only Mode setting can make cloning easier in some cases such as removing dark objects against a light background. When you clone another part of the background over dark areas, only the dark bits are replaced. Similarly Darken Only is useful for removing light objects on a dark background. To further refine what areas are affected by the clone tool, you can create an amount mask based on properties of the underlying image such as color, brightness or texture.