Lesson 15: Working with vector data

GIMP offers you the ability to work not only with bitmap data but with vector data as well. And on the same project.

Paths is a powerful drawing tool. At first from the strict technical aspect, paths have two significant advantages:

  • they consist of simple numeric data, so you get a very small file size, and
  • for the same reason, working with them is fast because very few resources are used on the machine.

But what is a path?

Simply put, a path is a set of one or more lines which are defined mathematically - so they are described and manipulated with precision, even when created freely (freehand, "optically").

A path may consist of any kind of perceived segments: straight, curved, freehand. Curved and freehand lines basically consist of Bezier curves. Bezier curves -as perfectly explained in the GIMP's help- is a fundamental mathematical technique to represent curved lines.

So by using lines that are mathematically expressed, you can draw vectorial lines, curves, shapes, geometrical elements and figures. You can import or export this kind of items. Still more and apart from these possibilities, inside GIMP you can use a path for two important actions:

  • you can convert it to a selection, and
  • you can stroke it - that is you can use the line either to paint or to execute an action with the Toolbox's pixel affecting bitmap tools across the line.

Creating and editing paths

GIMP has a full-fledged drawing machine. You can create paths with the Paths Tool, the 8th tool in your Toolbox. Not anyone is interested in drawing and it would make no sense of course to reproduce the documentation, so if you are seriously interested in drawing the documents are right there waiting for you.

The Paths dialog is one more dockable dialog in the GIMP's interface - you guess right how to access it: Windows > Dockable Dialogs > Paths. Paths are created with the Paths Tool: by selecting it, you create nodes, one after the other. If you drag after clicking, you can draw curved segments. You can return on a path to edit the nodes, selecting it on the Paths dialog first. You can edit nodes and segments in any aspect. There are many shortcuts to help you work fast and hints appearing on the statusbar and your pointer adjusting to the various actions. In the History dialog GIMP keeps track of all your actions while working on your paths, so you can move back and forth easily. Of course you can work with guides for absolute precision having 'Snap to Guides' enabled. In the Paths Dialog you can manage your paths, make them visible on the image if you want, rename, enable/disable, duplicate, copy, paste, delete, and you can import/export them in the SVG format with interesting options. Doubleclicking on the Paths tool you access its options. In the dialog area named 'Edit Modes', in 'Design' mode you draw, in 'Edit' mode you edit a path in detail, in 'Move' mode you move components of the path or the whole path. With the 'Polygonal' option you draw only straight lines.

Combining the power of paths and selections

With Select > From Path -or rightclick on a path in the Paths Dialog and then Path to Selection-, you can convert a path to a selection. With the next three commands when rightclicking on a path -yes you guessed right- you can add to, subtract from or intersect with the current selection. The GIMP's interface offers you once again all possible logical options to work with selections using paths.

And of course there is also the option to convert an existing selection to a path, with Select > To Path -or by rightclicking inside the Paths Dialog and Selection to Path.

Note: converting a selection to a path

When you convert a selection to a path, the contour line follows the marching ants. In case there is a feathering you have to keep this in mind. Extra commands that have to do with feathering/shrinking/growing your selection may be of help.

Stroking paths

Stroking a path implies an extended meaning of painting. Stroking in GIMP basically means two ways to affect a layer's pixels by using a path:

  • simply painting using a solid color or a pattern and controlling the line style and width,
  • affecting the pixels using any one of the "pixel affecting" tools in the Toolbox (from Pencil to Dodge/burn).



The Stroke Path dialog has two areas. Using the first area, you can apply on the path the FG color adjusting the line width/style, or you can apply the current pattern. Using the second area, you use a paint tool for the stroke, selecting the tool and deciding if you want the brush dynamics. The important thing to understand is that the stroking action is done with the current tool settings just like if you execute the painting action freely by hand, but your gain is that the computer draws it for you precisely. This possibility should make you think creatively, opening up your imagination to combining the vector logic with the raster logic.

Saving and reusing paths

Paths are saved inside your project: if you save a XCF file you will have your paths there when opening your file the other day. But paths can be also reused inside or outside the GIMP, that is to say to and from other applications.

You can copy a path and paste it on another project. There is even a better way for the copy, just drag&drop the path on the other image. You can export paths out of GIMP. Select the path, rightclick, export.




The 'Export Path to SVG' dialog comes up. You can export the selected path or all paths. You will get a tiny textfile, which is editable in a text editor, it is actually XML data.

And then you can import vector data, having the option of merging all paths to one in case the textfile has more than one of them. You can also scale the import, so that it is resized to fit inside the canvas.




The thing called Transform Lock

In Lesson 12 i explained the Transform Lock. Repeat, once again:

  • The transform lock applies not only to layers - it applies to any channel and any path that currently has the transform lock.

This concept is important to be understood, and i think that we do not need one more video for this, you simply have to take it logically. Now keep following me, please!

It is naturally expected that you will find yourself in situations where you need to perform a transformation action on a layer -like scaling or rotating- but you need to keep some paths logically connected to the layer in their relative position, so as to be able to work with them on your layer after the transformation. Clear the need, clear the problem, right? The Transform Lock comes to your salvation.




You just check the transform locks on the layer and on the path before executing the transformation. Problem solved.

But you might ask, hey, OK with paths, what if i want to keep a selection available for my layer after the transformation? Good question - and good questions mean good learning. So here comes the good answer. A selection applies on the whole image and not on the layer level - and as you already know this is important because it lets you work with selections from any layer to any layer. Channels now come to your salvation. As we learned in Lesson 9 about saving and reusing selections, you can save a selection to a channel inside your project, with the command Select > Save to Channel. Guess what? Channels can be transform-locked as well. So after the transformation, you can have your precious selection by rightclicking on your saved channel (the selection mask which has been transformed as well) and giving the command Channel to Selection. Problem solved.




Of course the only remaining problem is just one: you have to always bear in mind on what you have the Transform Lock on. But to be really honest, this is precisely your problem, neither GIMP's nor anyone else's. ;-)

Paths for design elements

Paths are meant to serve as tools to design graphical elements. In this context GIMP offers various commands for possibilities that have to do with the ways they can be used.

  • You can create a path out of a text layer, with the command Layer > Text to Path (or by rightclicking on the text layer and Text to path).
  • You can create a path from a selection or vice versa, as said.
  • You can create or edit a path using guides for absolute drawing precision.

These tools altogether should open up ideas and possibilities for a creative mind. With all these commands and combining the possibilities of paths and selections, you have at hand all tools and options to do all essential tasks and work effectively with very complex selections - which is apparently and basically important in drawing.

The tools are well designed, intuitive and powerful, offering the basis for effective work. After all that you have already learnt about the GIMP's interface, you are certainly going to find your way with paths easily. The more you play with these tools in action, the faster you are going to discover your drawing potential.

No comments:

Post a Comment