How to Use Clone Layers in Krita

Share
In this article, we will learn a bit about how clone layers work in Krita and how to use them.

What are Clone Layers in Krita?

Clone layers are a type of layer in Krita that allows you to place a copy of a layer elsewhere in the layer stack, effectively allowing you to draw something in one layer and having it appear in multiple places in the canvas.

Clone layers also allow us to create all sorts of cool non-destructive effects. For example, we can manually create a dynamic drop shadow effect by placing a clone layer underneath its source making it look like a shadow.

An example of a simple drop shadow effect with a hard edge created in Krita with the layers structure visible: the layers are a "Source" group with a "Text" layer inside, then a "Simple Drop Shadow Effect" group with a "Clone of Source" with a layer style, attached to it a "Transform Mask 1." And finally a Background layer.
The layer structure of a simple non-destructive drop shadow effect created in Krita.

How to Add a Clone Layer in Krita?

To add a clone layer, select the layer you want to clone in the Layers docker and click the plus button that shows the types of layers you can add. While a layer is selected, the option to add a clone layer should be clickable.

The location of Krita's "Add New Layer" popup menu in the "Layers" docker.
The location of Krita's "Add New Layer" popup menu.

What You Can't Clone

It's not possible to create a clone layer for a mask (e.g. transparency mask, filter mask). While a mask is selected, the option will be greyed out.

It is possible to create a clone of a layer group. However, if the Pass Through property is enabled on the group, the clone won't work.

Changing the Source of a Clone Layer in Krita

After creating a clone layer, it's possible to change its source by right clicking on it and choosing the option "Set Copy From" in the context menu. A dialog will appear with a single dropdown list button that lists all your layers, and from there you can select a new source.

Proxying Clones

If you use more than one clone layer or you think you'll have to change the source in the future, there are two tricks you can use to avoid having to open that dialog more than once.

The first trick is to place the layer you want to clone inside a layer group and then clone the layer group instead of the layer. Because you have cloned the layer group, if you want to change which layer is being cloned all you need to do is place a different layer inside the layer group and the clones will update accordingly.

The second trick, which is useful if you have multiple clones, is to make the other clones clones of the first clone instead of clones of the source layer. When you change the source of the first clone, the second clone will update automatically since it's a clone of the first clone.

Inheritance Rules: What is Cloned?

Pixels

It's possible to clone a layer or layer group. All sorts of layers can be cloned, however, the only thing that gets cloned is the image of the layer, its pixels.

For example, if you clone a filter layer that applies a Gaussian blur, the clone doesn't apply a Gaussian blur elsewhere, it simply works as if you copy and pasted the blurred result and placed it elsewhere.

This can have unexpected consequences. For example, cloning a vector layer and then transforming the clone will result in a blurry image despite the fact the source is a scalable vector graphic. That's because the clone only clones the rasterization of the vector layer, i.e. it only clones the image after the vector has been turned into pixels.

Amazingly, it's possible to clone a clone layer.

Note: the reason why Pass-Through layer groups don't work with clone layers is because they have no pixels to clone. More technically, Krita calls the temporary images created while processing the layer stack "projections."

Masks: Yes.

If the source has masks applied to it (transparency masks, transform masks, filter masks), then the final result after applying those masks is cloned.

Opacity: No.

The Opacity property of the source layer won't be cloned, which means if you set the opacity of the source to 50%, the clone will have 100% opacity by default.

A work around for all cases in which a property isn't clone is to place the layer inside a layer group and clone the group instead, e.g. if you place a 50% opacity layer inside a layer group, and then clone the layer group, the image will be cloned correctly because the opacity of the layer group is 100%, not 50%.

Blend Mode: No.

If the source has a non-normal blend mode, such as Multiply, it won't be cloned.

Styles: No.

If the source has layer styles applied to it, they won't be copied.

Visibility: No

The source of a clone can be made invisible by clicking on the "eye" icon in the Layers docker without affecting the clone's visibility. This is a very interesting feature that can be used in various ways.

If you are creating complex effects using clones, you can hide the source to see only what the effect looks like without the source being displayed.

In some cases you may have an effect that uses two clones of a source but needs the source itself to be invisible. In this case, you can just make the source invisible without affecting the clones.

A practical example of this is the chromatic aberration effect, which requires you to extract two colors from the source and add them together at different positions, but you don't need the source to be visible.

Tip: Krita doesn't let you draw on a layer that is invisible, but it does let you draw on a layer with 0% opacity. If you want to edit the source and see the effect update but the source has to be invisible, make it 0% opacity instead.

Non-Destructive, Real-Time Chromatic Aberration in Krita: a tutorial image describing the steps necessary to achieve the effect: Step 1: Use a flat color fill layer with "multiply" blend mode to create a monochrome image; Step 2: Make black transparent with a cross-channel adjustment filter; Note: If your input is transparent, add a clone of the input above the filter with "Destination In" blend mode; Step 3: Create a clone of the extracted color under it, with "Subtract" blend mode to remove the red color from the input; Step 4: Add the red color back by changing the "extracted color" blend mode to "addition." This should show the original image; Step 5: Place the "extracted color" into a group, change the group blend mode to "addition," add a transform mask and move the transform mask around with the transform tool; Tip: Use warp transform, mesh or liquify to get rid of the lack of red at the edges; Photo by domantasm. on Flickr; VirtualCuriosities.com
Image version of the tutorial "How to Add Chromatic Aberration in Krita (Non-Destructive Effect)." Photo by domantasm. on Flickr (CC BY 2.0).

Inherit Alpha: No

The inherit alpha setting is not inherited by clones.

Locked Pixels & Alpha: No

If the source is locked, or its alpha is locked, this doesn't make the clones locked.

Conclusion

Almost every property of the source layer isn't cloned, allowing you to easily customize how clones are blended.

If you want to clone these properties you can simply place the layer you want to clone inside a layer group and clone the layer group instead.

Personally, I found a bit surprising that masks are cloned but styles are not. From this we can imagine that the order of operations goes like this:

  1. Masks are applied.
  2. Clones are updated.
  3. Styles are applied.
  4. Opacity is applied.
  5. Alpha is inherited.
  6. Layer is blended.

What Can You Do With Clone Layers?

Moving Clone Layers

After creating a clone layer, you can move it using the Move tool. You can't transform it. To do that you need to add a transform mask to it, and then transform the mask.

Note: for some reason if the source is the background layer the clone layer will always fill the entire canvas, even after moving it.

Combining Blend Modes

You can use a clone layer to mix multiple blend modes together, e.g. normal and multiply, by making both source and clone 50% opacity.

It's also possible to use a different transparency mask on the source and in the clone, so it has different blend modes on different parts of the original image. Since the masks are applied to a layer before it's cloned, to do this we will need to place the source inside a layer group and place the mask in the group instead; the mask for the clone can be used directly in the clone.

Combining Layer Styles

It's possible to have the source and clone feature different layer styles, and you can blend them any way you want, e.g. merging two drop shadows of different colors together.

A screenshot of Krita showing the layers docker next to the text "Multiple Stroke" featuring a multiple strokes effect. The layers docker displays the layer structure of the project. At the bottom, a grey background layer. Then a layer group called "Effect Source" with a "Text" layer inside. Then a "Clone of Effect Source" a layer group called "Orange Stroke (5px) with a layer style applied. This group is inside another group, which is inside another, and another. The topmost group called "Stacked Method." Above this, a layer group called "Layered Method" containing the exact same effect in a different structure. Its bottom layer is also a "Clone of Effect Source." Then, from bottom to top: 2nd White Stroke (48px), 3rd Purple Stroke (43px), 2nd Purple Stroke (35px), 1st Purple Stroke (15px), 1st White Stroke (10px), and Orange Stroke (5px).
A multiple stroke text effect created in Krita using multiple clone layers with decreasing stroke widths one above the other (layered method), and the same effect created using a "stacked method" instead.

Using Source as an Eraser or Mask

It's possible to use a clone as a clipping mask elsewhere, and even as an eraser. This can be achieved with various methods found in Krita:

  1. Inherit alpha.
  2. Erase blend mode.
  3. Destination in blend mode.
  4. Destination atop blend mode.

Transforming & Liquifying Clone Layers

A clone layer can be transformed using a transform mask. In Krita, transform masks are extremely powerful. Although mose people only use them for simple transformations, if you go to the Tool Options docker while they are selected you will see that you have several ways to transform a clone layer:

  1. Free transform (default).
  2. Perspective transform.
  3. Warp transform.
  4. Cage transform.
  5. Liquify.
  6. Mesh transform.

In particular, note that in some applications liquify is a filter, but in Krita it's built into the transform tool, which means you can edit your liquify after you have created it.

Warning: changing the transform mode from one to another resets the transformation you have created. If you want to try a different transform without losing data, simply create a new transform mask and make the first one invisible.

Problems Working with Clone Layers

Although clone layers work in a very straightforward manner, there are a few problems you may encounter while working with them, specially in regards to moving and transforming the clone and the source.

Moving the Source Moves the Clones

If you move the source of a clone, the clone moves with it. Consequently, you should avoid doing this if you need precise placement of the source.

If you want to move the source without moving the clone, a workaround is to create a second clone of the source and move it to where you wanted the source to be, and then hide the source, since the source's visibility isn't inherited by the clones.

My Clone Layer Disappeared!

In some cases, when you have too many effects, Krita appears to simply forget to render some layers.

In this case, it's possible that your data hasn't been lost yet, Krita just gave up doing its job. You may be able to make it "reappear" by hiding and displaying the layers are disappeared, or their layer groups, triggering Krita to re-render the effects you have applied.

Partial Canvas Updates / Lagging Artifacts

Similar to the above, sometimes Krita will only partially update the canvas leaving some rectangular edges separating areas it simply didn't update.

This sort of problem is more common with features that are least used, thus less tested, thus more buggy. Sometimes the only thing you can do is give up and try a different approach.

Multiple Transforms on a Single Clone

Using multiple transforms on a single layer is technically possible, but it works in unpredictable ways that are impossible to actually edit. It also seems to be very buggy. I recommend avoiding this if possible.

A workaround is to place the second transform mask on the layer group instead.

Important: transform masks are very fragile! You generally can't, for example, copy one transform mask and paste it in another layer, because it will transform it wrong. I assume this happens because the origin (as in rotation and scale origin) of the transformation changes.

Flickering & Imprecise Transformations

Transform masks are rather imprecise and there is no way to manually edit the transformation matrix in Krita to make them do exactly what you want.

For example, if you create a simple mask to create a "mirror" of the source like the symmetry option in Krita would do, you may notice that sometimes the center will flicker because the transformed clone randomly shifts 1 pixel back and forward depending on how much you have zoomed in, and how much you have panned the canvas.

I'm not aware of any way to fix this, unfortunately.

One workaround that is technically possible is to use transform masks to preview what you want to do, and then before exporting your project you manually copy and paste, flatten, and transform your work so that it's actually pixel perfect.

Recursive Transformations

Once upon a time I did something pretty cool! I took a layer group and cloned it, and change its transformation. Then I put the clone inside a layer group, and cloned it, and changed it transformation. Then I put that clone group in another layer group, and changed its transformation!

The result after doing a few times? Krita was barely responsive!

If you want to do recursive effects, a workaround is to take the first few iterations and create a flattened copy of them, and then just use this flattened copy as a placeholder source for the next iterations. For example, if you are doing something like golden ratio, you can take the source plus the 3 first iterations to create a rectangular frame, and then just scale down this frame 2 or 3 times until it's invisible. You can update it from time to time when you need it, and just do the whole thing manually when exporting.

Other Tutorials

Someone made a video tutorial showcasing some neat things you can do with them if you are an illustrator. Check it out.

Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments