Lineart extraction made simple

Tutorial: lineart extraction made simple

Leggi in italiano

Digital conversion may ruin your drawing no matter how beautiful it is. But don’t worry: I wrote this tutorial to make you able obtaining by software a digital lineart even better that the one you drawn.
I define my drawing workflow as an “anlogic/digital” process. It starts with a pencil draft, than I perform the inking using a calligraphy pen or several markers of different size, I remove the pencil using an eraser and eventually I scan the drawing and I finish the process by software.

The latest phase starts with a crucial step, that is the lineart extraction. I’m going to explain you how I complete  this stage with small efforts using a graphic software.


Usually I avoid to write step-by-step tutorial related with software usage because they became obsolete one second later I click on the “publish” button. However I hope that also the low-experience users are able to find the commands described in the guide even they have a different version of the software. In this tutorial I use Photoshop CS3 , but you can obtain the same result using the freeware software known as GIMP,
Stop speaking, let’s start.

Preliminar steps

Once you drawn and inked your drawing, you have to scanner it. To do that I use my cheap all-in-one series HP printer.
Set the scanner output to grayscale and the resolution to 300 dpi, that is a good tradeoff for almost all applications.

Find here, as an example, my tribute to Prince just after the scanning:

Prince scansione lineart senza ritocchi

Not so effective, isn’t it? The good news is that it can be improved easily.

After the scanning a good habit is to improve the contrast. Photoshop allows to do this in several ways. The simplest option is to select Adjustments->Auto Levels in the Image menu (sorry, no menu traslation available for the figures).

Photoshop visualizza livelli automatici

But I prefer selecting the Contrast Curve option because it allows to better manage the entity of the contrast burst . You can enable it selecting Image->Adjustments->Curves… A window showing the image histogram will be opened. The curve representing the function relating input and output greyscale pixel values is also showed overlaying the hinstogram (at the beginningit is the diagonal line, because the input is equal to the output).

Photoshop visualizza curva di contrasto

In order to enhance the contrast you have to drag up the diagonal line creating a curve. Enabling the preview checkbox you can see the effect on the drawing in real-time. Stop moving the curve when you obtain the  desired effect.

Photoshop, curva di contrasto

Here is the output of the contrast enhancement by contrast curve option:

Prince lineart contrasto maggiore

This is already a little improvement, but also if it is not so visible, a full-size view shows that many defects have to been correct.

Prince dettaglio imperfezioni

The lineart should be improved through several actions. First of all, you have to remove any residual pencil marks. Then it is important to create variations in line width. The line width should be greater in the shadow areas and smaller in the light zones. Moreover you have to avoid that your lines ends suddenly with no tapering, expecially, but not only, in the subject’s hair. This is why I use calligraphy pens, that allow for more varied lines, or markers with different size. For the same reason I suggested you to set the scanning to grayscale: that captures the more delicate lines and allows for some value variation.
In any case, you can perform these steps in postprocessing using the brush and eraser Photoshop (or equivalent software) tools. I admit that sometimes I’m too impatient and I skip these steps, but I always regret it, so…never do it!

After finishing corrections, it is also good to blur the lineart to make it homogeneous. Even in this case, among the many options that Photoshop offers, I prefer the one that allows me to modulate the effect, that is Gaussian Blurl… enabled by choosing Blur from the Filter menu. Again, you will see a window open and you can enter a value (even decimal) that adjusts the impact of filtering. The preview option helps to not exaggerate.

Photoshop, Filtri->Sfocatura->controllo sfocatura...
My final advice is to open the Layers panel, position the mouse pointer on the only layer of your image, usually called “background”, and select the Layer From Background option from the drop-down menu that is shown by right-clicking. If you do not, some Photoshop options will not work for that layer.

Photoshop livello da sfondo

How to extract the lineart

Well, we’re almost there: our lineart is ready to be separated from the white background in a few steps. To find out how, you just have to continue reading and and if you will arrive to the end of this tutorial, I’ll also tell you how to avoid unrecoverable errors.

Step 1: Select the lineart. If you are thinking that the most intuitive way to proceed is to select the white areas of the image with the magic wand tool and then erase them with the rubber leaving only the black strokes, you have to know that you could do but it would be a bloodbath. Moreover, you would not get the desired result in the black/white transition zones. Luckily you can select the lineart in a simpler and more accurate way.
Open the Channels panel by selecting the same option from the Window menu. Since you scanned the image in grayscale, you will see only one channel.

Photoshop, canale come selezione

At the bottom of the channels panel, click the “dashed circle” icon (“Load Channel as Selection”), then invert the selection (SHIFT+F7 if you are too lazy to use the Selection menu). All and only non-white pixels are now selected.

Step 2: set the foreground color to back (in Photoshop you can do it just pressing the “D” button in your keyboard).

Step 3: create a new layer selecting the appropriate item in the menu Layer (keyboard shortcut CTRL+SHIFT+N), rename it for an example “ink”chiamalo per esempio “ink”, and fill it with the foreground color (just press ALT+BACKSPACE if you are a Windows user or COMMAND+DELETE if you use a Mac).

Step 4: return to the”background” layer, select all (CTRL+A) and press DEL or BACKSACE.

At this point, you’ve already got what you want: your lineart is on a separate level from the background, as you can easily verify by hiding the “background” layer.

Prince, lineart scontornata

Since I prefer strong lines, and since usually my lineart is not a perfect lineart, I experimented some additional step to improve my lines. Continue reading in order to find out such tricks.

Step 5: return to the “ink” layer and select the lineart as I explained in Step 1. Then open the “Paths” panel (from menu, select (Window->Paths) and create a new path using the icon at the bottom of the panel (see the green rectangle in the figure).

Photoshop, crea tracciato

Step 6: in the paths panel, right cick on the path you created and select crete selection from path in the context menu.  A new window to set the selection parameters: the default values are  ok, so just clock on the “Ok” button.

Photoshop, crea selezione da tracciato

Step 7: again, create a new layer (CTRL+SHIFT+N), rename it, as an example “trace”, select it and fill theselection with the foreground colore that is supposed to be black (if not, press D in the keyboard). Here is the output:

Prince, lineart scontornata

At this point you have finished, you have just to convert the image from greyscale to RGB or CYMK selecting Image->Mode->RGB. Now you are ready to the next step, that is adding colors.

The last choise is between the linearts: do you prefer the one in the layer “ink” or the one in the layer “trace”? Here is the comparison…

Prince, lineart digitali a confronto

…and an enlarged detail, in order to highlight the differences.

lineart comparison

The “trace” lineart (on the right) is cleaner and its contourns are stronger, but there are no gray variations, so it is important to play with the linewidth to improve the drawing’s dynamic. Onthe contrary, the lineart “ink” (on the left) is more fluid and it’s not perfect.

There is no better choice than the other, it’s just a matter of taste and style. I prefer the web contours of the “trace” version, especially because it allows me to remove any pencil residue from the background. What’s important is that you make your choice at this point, which is also ideal for correcting the lineart again with rubber and brush. It is important to do it before proceeding with the stain because if you find yourself in a too thick line after adding many other levels, you will find a surplus of work to eliminate bumps that were previously covered by the thickest line on the offending line.

In any case you do not have to delete the lineart discarded, just hide the level that contains it.


Other notes and some life-saving advice

Of course, a black lineart is not mandatory: you can very well create it with another color (or color it differently at a later time).
With appropriate selections and copy-paste sequences, you can also spit the lineart ito multiple levels, e.g. one containing the lineart of the face, onother the rest of the body and so on. You can also choice a different color for each lineart segment, but in this case I recomand you to make sure to create close shapes, because it will simplify your life in the coloring phase.

When I’m satisfied with the lineart work, I make a copy duplicating the level, I block it by clicking on the padlock that appears in the Layers panel and hiding by clicking on the eye icon:

Photoshop, blocca e nascondi livello

In addition to the lineart layer backup copy, i also locks all levels except the one on which I have to work. I do it because when you draw digitally you have to create several layers and it’s easy to forget in which one you are working. It may be frustrating to find that you have added shades on the lineart level, or on the color level.

The reason why I backup the lineart is that sometimes I make adjustments after having added color and shadows, or  I add bad lines noticing to late that the modifications degradate the drawing. In these cases I can fix such mistakes by deleting the level of the compromised lineart and replacing it with the backup copy.

To duplicate a layer you have to move the mouse pointer to the Layers panel at the level you want to duplicate, right-click and select the Duplicate Level option in the context menu that has opened in the meantime.

Well, with this I think I’ve explained you in much detail how my artworks jump from sheet to the monitor. Remember: this is my personal workflow, which allows me to get drawings in my style, so it’s not said that it’s good for you and your style too.

The almost 2,000 words of this tutorial are the result of many hours of work that, I hope, may be useful for you! If this is the case, please do not hesitate to share it on your social account and give me your opinion with a comment.

Thanks in advance and see you at the next post!

You may also like

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *