Quick vector inking tutorial

Make art for user-made content.

Moderator: Forum Moderators

Forum rules
Before posting critique in this forum, you must read the following thread:
Post Reply
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Quick vector inking tutorial

Post by Sgt. Groovy »

I got a tablet for xmas, and seeing how useful it is, I feel sorry for those still stuck with their mice. For that end, I've deviced a tutorial for inking sketches using a method more suitable for mouse. Since freehand tracing with a mouse is very difficult, the method relies on bezier curves. Whereas in freehand tracing you have to follow the line all the way, with beziers you only have to touch it in relatively few places. A vector drawing program is needed, and in the tutorial Inkscape is used. The knowledge of general usage of vector drawing is assumed.

The usual beginner way to make beziers is to first make an approximating polygon and the round the edges one by one. This works but it's more work than necessary. Quicker method is to click and drag in tangential direction to the line. The following picture shows a sample shape and the points where it's needed to touch to make a bezier path. The corner points only need to be clicked on, while the curves need a click-and-drag following the directions of the arrow (the shape is traced counterclockwise). How close the control points need to be depends on how often the curvature of the line changes, but the fewer points you need, the better. With a little practice you can trace any shape quickly.

Image

Let's then try an actual picture. The following picture is a scetch of a bottle, maybe containing some magical potion.

Image

In the next picture the sketch is traced with paths, having been stroked with a line whose thickness is what is going to be the average line thickness in the final picture. One of the paths is coloured red to make it easier to see the separate paths. Since beziers can't fork, most drawings need several of them, and it's usually good idea to follow the natural shapes of the object. If the object has round or oval shapes, you can also use the ellipse tool to make paths. After you have made the needed shape, do Path->Object to Path. The problem with using ellipse is, though, that, depending on the quality of the rest of the linework, they may look too clean and unnatural. After turning them into paths you can always adjust the control points to make them slightly less-than-perfect.

Image

Generally it's better the less nodes your paths has, and you can decrease their number with Path->Simplify, though it will slightly distort the shape.

In most drawings there are usually two kinds of lines, "hard lines," which enclose the colour flats and separate them from each other, and "soft lines" which overlap flats and might be drawn in darker shade of the flat colour instead full black. In the sample picture the only soft line is the small curve at the base of the neck of the bottle. If you want to treat hard and soft lines separately, put them on different layers.

The problem with paths is that the stroke is always constant width, which will make the image look dull and formalistic. To deal with this we select all the paths and do Path->Stroke to Path, after which the paths will lie at the edges of the lines instead of centre, and the linework now consists of closed paths filled with colour, instead of stroked paths. You should also do Path->Union, which will combine the paths into one and fuse them on parts where they overlap.

Now we can change the thickness of the lines by adjusting the control points. In round shapes, like the cap of the bottle, you can just select all the nodes of the inner subpath and move them all together. This will thin the line in one direction and thicken it in the opposite direction. In other parts the sculpting feature may come handy, where you select a number of nodes, and when you move one of them by Alt-Click-Dragging, the other move as well, but a distance proportional to their distance to the dragged node, like you were stretching a sticky substance.

In the next picture the nodes have been moved to change the line thickness in parts, to make it look more like a handdrawn picture. Now you can add the colour flats. Select the path making the "hard" lines, do Copy, add a layer for the flats, and do Paste in Place, followed by Path->Break Apart. Delete the outermost path, and what's left is the exact copies of the paths making the "holes" of the linework, except they are filled paths. Select them, and do Path->Outset, to make the flats a bit larger than the holes they are supposed to fill, and put the flats layer under the linework layers. This way, if you move the image to GIMP, you'll be sure not to have any orphan pixels between the flats and the lines.

Image

After you have made the flats, you can give them whatever colours, gradients or patterns needed. The last picture shows the bottle, shaded with gradients (the neck and the base of the bottle have their separate flats).

Image

If you want to work your picture further in GIMP, there are to ways to import it there. GIMP can import an SVG image, where the image is rendered to raster in one layer (resolution is queried) and all the paths are also imported as GIMP paths. A more handy way is to save your image from Inkscape in xcf format. It is rendered to raster, but the layer structure is preserved, that is, each Inkscape layer is rendered to its own GIMP layer. If you have given the flats paths constant colours, it's very easy to select them in GIMP with the magic wand tool.
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
User avatar
battlestar
Posts: 690
Joined: January 1st, 2007, 7:12 am

Post by battlestar »

Good tutorial. Does anyone know how to change the line thickness using photoshop?
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

This tutorial presumes a vector program, and Photoshop is a raster one, but the same method is theoretically possible there as well. PS most likely has bezier curves which can be stroked with a brush, and if it doesn't has "stroke to path" function, this can be emulated: create a temporary layer, say white background, and stroke your path on it with black. Then make a selection by the black colour and turn this selection into path. You now have a path that surrounds the stroked original path. Delete the temporary layer, adjust the path nodes to change the line widths, change the path into a selection and fill the selection with black (or any other colour you want the linework to be drawn with).

So, it's basically possible in a raster program as well (GIMP too) but it's more complicated and generally the interface for managing paths is better in vector programs.
Last edited by Sgt. Groovy on February 1st, 2007, 7:07 pm, edited 1 time in total.
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

The adobe vector based graphics program is illustrator
User avatar
battlestar
Posts: 690
Joined: January 1st, 2007, 7:12 am

Post by battlestar »

Oh i get what Groovy means now, nevermind what I was asking. It's the same thing in photoshop, for this.
Yanshee
Posts: 34
Joined: December 13th, 2005, 7:49 pm
Location: Brussels, Belgium
Contact:

Post by Yanshee »

You really shouldn't use a raster program to do that. Even if it has vector paths abilities, raster programs are not made to do vector art. As Groovy stated, it is way more complicated, and you lose all the flexibility a vector program gives you. For example, changing the color or the thickness of a vector object is done quick and fast in a vector program, as in a raster one, you'll have to delete a layer, create another one(don't forget to create another one, otherwise you'll probably fill the color on another object you don't want !), fill it with the right colour, etc... and you'll end up with tons of layers. Unless you're in the graphic business (and even if you're into it...), you don't really need those expensive vector programs like Illustrator, Inkscape is free and open-source and can perfectly do most of the jobs. A little tip that may be useful to some of you: when drawing a picture or a scan in a vector program like Groovy's tutorial, I always find it useful to put my picture on another layer, changing the alpha of the picture to about 50%, depending on the picture, then locking the layer so I'm sure I won't accidently move the picture, and to draw on the layer under the picture, that way, even when drawing, I can still see the picture above my vector art. I'm not sure I've been clear: import your picture on a layer, change the alpha of the picture so it's semi transparent, lock the layer, create another layer and put it under the picture's layer, now draw on it... :P

PS: if you're under Linux, there's another really great open-source vector program called Xara extreme. There's also a Windows version of it, but as the Linux version is free, I think you have to pay for the windows version, not sure though... http://www.xaraxtreme.org/
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

That's a good point, and it's actually how I've done things myself too. I have to include it when I put the tutorial in the Wiki.

That Xara program sure looks interesting! It's actually in Debian already, although only in unstable (though the dependencies are up-to-date if you're running testing). The ppc version isn't functional, though, there's some bug preventing creating new files. :(
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
User avatar
Sgt. Groovy
Art Contributor
Posts: 1471
Joined: May 22nd, 2006, 9:15 pm
Location: Helsinki

Post by Sgt. Groovy »

I just figured a way to make a variable-width outline for any path:

1. Coose the desired colour for the path, and set the stroke to none.

2. Do "Edit->Copy" followed by "Edit->Paste in place". Now you have a copy of the path exactly on top of the original. Set the new path's fill to none, and stroke to black. Set the the stroke width to a number that is at least as much as the desired outline's thickest width plus thinnest width. If you set the stroke opacity less than 100% you can see the original path under the line, which makes things easier.

3. Select the new path and do "Path->Stroke to path", and then move this path to the direction of the light source (in general, you'll want the outline to be thin in the lit side and thick in the sadow side). Move only so much that the edge of the original path stays inside the outline path.

4. Do " Edit->Paste in place" once more and you get one more copy of the original path (because it's still in the clipboard), select both this new path and the outline path and do "Path->Intersection", and the part of the outline path that lies outside the original path is clipped away. What you are left with is a nice wariable-width outline on top of the original path.

This is a dumb method, where the line thickness only depends on the angle of the line, but it's easy to fine-tune it by moving the control points.
Attachments
outline.png
outline.png (57.54 KiB) Viewed 7816 times
Tiedäthän kuinka pelataan.
Tiedäthän, vihtahousua vastaan.
Tiedäthän, solmu kravatin, se kantaa niin synnit
kuin syntien tekijätkin.
Post Reply