Note: This tutorial was transfered from my old website, and it's now updated with more information
Before we start, we need to define several stuff:
- PathTool (aka PenTool) - A tool use to create paths.
- Point (aka Anchor) - self explanatory :D
- Line (aka Segment) - a connection between 2 points (not more and not less then 2)
- Control (aka Handle) - a special kind of point that controls the curve of a Line. From each point you have 2 controls - one for the line that ends at the point and one for the line that starts at the point.
- Stroke - one or more Points (Anchors) which are conected to each other. A closed stroke is a stroke where the first and last points are connected, and an Open Stroke is a stroke where the first and last points are not connected.
- Path - a path is a collection of one or more strokes
|An illustration showing the different parts of a path. |
There are 3 strokes in this illustration:
(1) a classical curved stroke, (2) A polygonal stroke and (3) an open curved stroke
PathTool Tutorial - Basics
|The tool options tab showing the options|
for the path tool
Here is a basic demonstartion of using the Pentool/PathTool:
|An illustration showing how a segment between two|
points bends, depending on the positions of it's handles
Now we need to explain 2 more things:
- An Active Point is the last point (anchor) that you clicked on. A point can also become active if you drag a line that it's connected to (see explanations in the illustration below)
- A control (handle) becomes visible only if the point it's part of is active.
By controling the handles you can have up to 2 curves per line so if you want more you will need more dots.
In the animation above I clicked on the line and dragged, once next to each point.
Excercise - Drawing a tip of a brushNow let's try to be more practical: let's create something!
|An illustration showing what|
you should do
Create the first two points by clicking on the canvas (while using the path tool in design mode) and then bend the line between them as showed above (by clicking on it and dragging). To curve the path like this I first clicked next to the bottom point and dragged to the right and then clicked next to the top point and dragged to the left.
Now create the third point by cliking the canvas in the position showed above.
What happened?! why didn't the new point Connect to the old one?
The answer is simple: GIMP connects the new point only when the active point before you created the new one, was at the end of the path (when a point is selected and becomes active it will look empty and a frame will appear in the place you should have a filled circle). When dragging the segment between two points, both of them become active and so GIMP doesn't know which point to connect to the new point.
In order to reconect this point, make sure it's active (if not, click on it), now Ctrl+Click on one of the dots at the end to connect it. Most of the times you won't need to do manual connections since the points will be connected automatically. This only happens if you have more then one active point or when the active point is not at the end of a path.
Later on in this tutorial, we'll see how to bend line segments without going through this trouble.
We will now delete the newly created point (it was created for education purpose only, to show you the above bug and how to connect points) by clicking the backspace or delete buttons on the keyboard. Now connect our second dot to the first one.
Now bend the new line segment as shown below (drag the line first to make the handles emerge, and the fine tune the curve by moving the handles)
|Finishing the tip of the brush|
- Design - Deafult
- Edit - Ctrl
- Move (Stroke) - Alt
- Deleting - Holding Shift on Edit (Ctrl) mode and clicking on it. See the comment at the end of the tutorial about straighting curved strokes.
- Moving - Clicking on it and dragging in Design mode.
- Adding at end - Design mode, active point should be open at one side
- Adding at the middle of segment - Clicking on a segment in Edit (Ctrl) mode
- Deleting - Holding Shift on Edit (Ctrl) mode and clicking on it
- Moving - Clicking on it in and dragging in Design mode
- Connecting - Clicking on a point in Edit (Ctrl) mode while both active point and the point you are clicking on are unconnected at 1 or 2 sides
- Deleting - Holding Shift on Edit (Ctrl) mode and clicking on it
- Moving (When Visible) - Clicking on it in and dragging in Design mode
- Moving (When Invisible) - Clicking on it's Point (Anchor) and dragging in Edit (Ctrl) mode
- New - Clicking anywhere in design mode when the active point is connected on both sides or when there is more then one active point or Clicking Shift while in Design mode and then clicking anywhere you want.
- Move - Clicking on a stroke and then dragging while in Move (Alt) mode.
PathTool Tutorial - Selections and Stroking
Selection - a selection from a path is basically the area inside the path. When the path is Open, it's treated like there is a straight line from the starting point to the end point.
When we have an area covered by 2 paths (or any other even number) it won't be selected. Imagine a ring in real life, the edges of the ring are 2 circles when one is inside another and the area covered by both rings is the hole.
When we have an area covered by 1, 3 (or any other odd number) it will be selected. When we have an area covered only by one path it will be selected since this is how we defined the selection. When an area is covered by 2 (or any other even number) paths it will be a hole so when we have 3 (or any other odd number) it will be full again since we have 1 path inside a hole (the 2 paths cancel each other so we we have nothing in this area except for the one path and then this is the selection)
|An illustration showing the selection created by different paths|
Stroking - stroking a path (to stroke a path) means to draw along it's lines. In order to do this simply click on the path you want to stroke inside the paths dialog (To open it, go in the menu to Windows→Dockable Dialogs→Paths) to make it the active path, and then go to the Edit→Stroke Path...
In the dialog that will pop you can select how to stroke the path, which tool to use it and you can set many other options - try playing with it.
|An Illustration showing some example of what can be achieved by different configurations for stroking the path|
Important Tips/Tricks for easier usage
Drawing Curved Paths
It's very annoying to have to draw a polygonal path and only then to curve it. In fact, you can draw a curved path right away! This requires a bit of practice but this is how it works:
When you create a new point in design mode, instead of clicking and releasing the mouse right away, click and drag. The handle will move to where you drag your mouse and this way you can create curved paths directly when drawing them!
A path looks smooth when it passes through a point, if both of it's handles look as if they are on one straight line.
|An illustration showing when a path is smooth|
Note that the two handles don't have to be symmetrical (when the point is the center of the symmetry) in order for the point to look smooth.
In order to make both handles symmetrical, while dragging one handle hold the Shift button and the other handle will become symmetrical!
Straightening line segments
If you want to draw a polygonal stroke, you can simply toggle the checkbox labled "Polygonal" in the tool options tab (see screenshot above). But, if you want to straighten one line in a curved stroke it's a bit harder.
A staright line segment is produced when the handle coming out from each of it's points, is exactly as the same location as the point - to achieve this one can simply "Delete" the handles (see keyboard shortcut above) of the two points of this line segment.