How to Change the Color of Lines After Drawing Them in Krita

Share
In this tutorial, we'll learn how to change the color of lines after we have already drawn them in Krita. There are actually 3 different scenarios where we may want to do this. First, if you drew lines directly on the opaque white background layer. Second, if you have lines in a transparent background. And third if you have a sketch from a scanner or camera that you want to change the color of. For the sake of completeness, in this article we will learn how to change the color of the lines in all of these cases.

Scenario 1: Lines on a Transparent Layer

If you have drawn lines on a separate, transparent layer in Krita, then changing it from one color to another is very easy. Simply follow the following steps:

1: in the Layers docker, click the checkerboard icon on the layer to lock the alpha channel. Locking the alpha channel makes it so you can't change the alpha (the opacity) of the pixels, but you can still change the RGB color of the pixels.

A panel labelled "Layers." In it, a dropdown list button reads "normal," and a spinner reads "Opacity: 100%." A filter icon button and a hamburger menu button can be seen. The main area is a list with 3 items, labelled "Group 2," "Paint Layer 1," and "Background." The paint layer is indented to indicate that its a child of the group. Several icons can be seen on each layer: an eye icon, a checkbox, a padlock, an icon with the Greek latter alpha, and checkerboard icon, and a brick wall icon. At the bottom, several buttons: a plus with a dropdown, a duplicate icon, a down arrow and up arrow, an icon that resembles sliders with a dropdown, and a trash icon.
Krita's "Layers" docker, featuring a group layer, a paint layer (selected), and a locked background. The icon to lock the alpha is the third icon, 3x3 checkerboard.

2: select the color you want your lines to become.

3: if you want all lines to become a single color, click on Edit -> Fill with Foreground Color on the menubar, or use the keyboard shortcut Shift+Backspace. Otherwise simply use the brush tool to paint over the areas you want to change the color of.

Scenario 2: Black Lines on the White Background Layer

If you are new to digital illustration or new to Krita, you might have made the grave mistake of drawing on the default opaque white background layer. Because this layer is fully white by default, you can't put fills behind it, and the technique above of locking the alpha won't work either because there is no difference in opacity between the default white background and the lines you have drawn on the layer—it's all fully opaque.

We can still change the color of the lines, though.

All we need to do is make white transparent, then we can use the technique above to change the color. This is easier to do if the lines are black, but it can be done with any color as well (except white, if you drew white lines on a white background, then nobody can help you). We will learn how to do it with colored lines in the next scenario.

To change the color of the lines in this case follow the following steps:

1: select the background layer.

2: click on Filter -> Adjust -> Cross-channel adjustment curvers... on the menubar. This will open a dialog for you to configure the filter that will be applied to the background.

3: change Channel to Alpha.

4: change Driver channel to Lightness.

5: drag the the control point at the right all the way to the bottom right. You should see the numbers "100" and "-100" displayed on text boxes indicating that when you have 100 lightness, that results in -100 alpha.

6: click OK to apply the filter.

This should have made your background layer into a transparent layer where white is now transparent and black remains opaque.

Now you can use the previous technique, by locking the alpha and filling the whole layer, to change the color of the lines to whatever color you wish.

Scenario 3: Change Blue Lines to Black, or Scanned Sketches

Many illustrators sketch with blue or some other color. If you do this, the technique above isn't going to work properly because any fully-saturated color is considered to have 100% Lightness. Another problem that can occur is if you use a scanned image the black lines aren't going to be 100% black, which means the method above will make them transparent as anything that isn't black will subtract the alpha.

We can fix this by making the color black first. To do this, follow the following steps:

1: click on Filter -> Adjust -> Desaturate... on the menubar. This will open the Desaturate filter dialog.

2: pick a desaturation method. If you have drawn with a fully saturated color in Krita, Min will likely make it black. Pick BT.709 or BT.601 if you are using an image from a scanner.

3: click OK to make it grayscale.

You should now have a grayscale sketch, but the color of your darkest lines isn't necessarily black. Let's fix that as well.

4: click on Filter -> Adjust -> Levels... on the menubar. This will open the Levels filter dialog.

5: click and drag the Input Levels' control points at the bottom of the histogram to adjust the range of your image. If your darkest color is mid gray, for example, the left control point should be at the center, which will make the filter turn mid gray into pure black. The histogram shows you the distributions of lightness on your layer. If you are working with a photo or scan, it's likely the paper isn't 100% white, so you will want to move the right control point to the left to make lighter colors into pure white.

A screenshot of krita levels filter settings as shown in the new filter mask dialog.
A screenshot of Krita's "Levels" filter settings as shown in the new filter mask dialog. The histogram in this screenshot shows that there aren't any very dark or very bright pixels, and there are more pixels with darker colors than with lighter colors.

6: click OK to apply the filter.

Now your image should be in grayscale and with lightness properly distributed. You can use the technique from Scenario 2 to turn your new black and white image into black and transparent, and then the technique from Scenario 1 to change the lines to any color you want.

Non-Destructive Method

On Krita, using filters directly from the menubar will apply filters destructively, meaning you can't undo these changes later. It's possible to achieve the same affect non-destructively by using filter masks or filter layers instead.

After you have added enough filter masks to make your image black to transparent, you can use a Color Overlay layer style with Normal blending mode and 100% opacity to change the color of your layer non-destructively.

If you want to create multi-colored line art non-destructively, you will need to use a clipping mask.

The steps to create a colored line art effect in Krita by drawing the line art color in a separate layer, placing both Line Art Color and Line Art in a group layer, and then using Inherit Alpha in the Line Art Color to clip it to the Line Art layer.
A method to easily create colored line art in Krita using a separate layer for the line art color.

Inverted Colors

If your image has white lines on a black background, you can still change the color of the lines with this method, but it will need some adjusts.

The easiest to understand adjustment is to use the Adjust -> Invert filter to invert the colors before doing anything else.

Alternatively, you can simply change the direction of the slope in the cross-channel adjustment filter to make black remove alpha instead of white.

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