How do I stroke a path in GIMP (or, just draw a line)?

7

2

I want to just draw a simple line in GIMP. The usual method, which I'm sure worked before, is to use a path then stroke it.

I selected the path tool, then clicked 2 points to make a straight line between them. Then I clicked the "Stroke path" button on the Toolbox window, and selected a size with what looks like standard options. But no line appears.

The path is showing in the Paths tab of the Layers window. Right clicking this and choosing stroke doesn't appear to do anything either. Did I miss something?

DisgruntledGoat

Posted 2011-11-11T16:18:51.613

Reputation: 4 068

In my case I had text layer selected. That was the reason my path didn't get stroked. – x-yuri – 2017-07-08T18:49:03.390

Interesting, I could not get the stroke path button in the Paths dialog to work either. Then I tried the menu entry Edit/Stroke Paths and it worked and after that the Paths dialog stroke paths button worked. – W_Whalley – 2011-11-11T16:45:53.267

same problem here! – thias – 2011-11-25T13:05:24.963

What's confusing is sometimes this works fine. I created a new image just now, made a path, then stroked it and voila, perfect. – DisgruntledGoat – 2011-11-25T16:14:59.297

Were you in the right level? – clabacchio – 2012-03-30T08:26:47.107

@clabacchio I don't know what you mean, what is a level in your context? – DisgruntledGoat – 2012-03-30T10:57:00.680

2Uhm sorry misstranslation...layer! And, maybe was the path out of the selection? – clabacchio – 2012-03-30T11:06:35.577

1If you're not that interested on the path and just want to draw a line you can use the brush tool. Click where you want point A to be, hold shift and then click where you want point B to be. – Alex – 2013-05-22T16:58:44.370

Answers

8

This is a great example of how hard-to-use GIMP is. The stuff is right there in front of you, but it is mystically difficult to actually use. Even after seeing the other answers, I still could not make it work, but persistence paid off. Perhaps this will help:

  • If a selection is active, optionally use Select | None to start a fresh selection.
  • Raise the Layers, Channels, Paths, Undo - Brushes, Patterns, Gradients dock if it is not already raised. When not raised, it is listed in Windows | Recently Closed Docks.
  • Click the Layers tab on the dock, click-select the layer to draw on, and make sure it is visible.
  • Click the Paths tab on the dock, click-select the path to trace, and make sure it is visible.
  • On the dock, right-click the path to trace, and choose Path to Selection. There are several ways to select the path, add a path to the selection, etc., but this is possibly the simplest for sake of teaching. In any event, a selection should appear that is tightly fit to the path. This default selection is almost certain to require modification...
  • Using the menu, expand the selection with Select | Grow. A dialog will raise. On it, grow the selection by at least the radius of the of the line to be drawn and click OK. Growing the selection larger is generally not a concern with respect to stroking a path.
  • Confirm that the marching ants bound an area sufficient for the stroke to draw, and that the area is within current selected layer boundaries. As needed, make adjustments to be sure the stroke can be drawn in the selected area.
  • On the Paths - Brushes dock, right-click the path to trace, and choose Stroke Path.... A Stroke Path dialog is raised.
  • Configure the Stroke details and click the Stroke button.
  • The desired results appear consistently, though mystically, the stroke jaggies can be quite terrible (at least for the path newbie). Anti-aliasing was my friend.

kbulgrien

Posted 2011-11-11T16:18:51.613

Reputation: 445

You do not need any selection to stroke a path this way. It is almost as if this answer was made more complex than necessary on purpose :) – Michael Schumacher – 2015-08-06T06:15:00.640

Actually, click selecting the path and clicking the red box icon below the path list is easier than right-clicking the path and selecting Path to Selection. – kbulgrien – 2013-09-13T21:14:40.707

Even simpiler, Select All. Another note: It seems that trying to stroke a path on a layer that contains text might create an issue such that even when the layer is selected, the stroke is not drawn. It may be beneficial to stroke a path on a layer, and merge it down as desired. – kbulgrien – 2013-09-16T15:50:25.797

Don't be baggin' on the Gump... It's almost like Photoshop, but remember that "Life is like a box of Chocolates..." – Fiasco Labs – 2014-03-23T18:30:51.023

5

To summarize what others have said, you have to make sure that:

  • the correct path is selected
  • the active layer is visible and big enough to contain the path
  • the selection (if any) contains the path

A simpler way to draw a line is to select the tool you want, click at the first point and Shift-click at the second. This way you can't move the points around as you can with paths, but you can simply Undo and try again if you get it wrong.

efotinis

Posted 2011-11-11T16:18:51.613

Reputation: 3 524

3

Forget Stroking a Path.

If you just want to draw a line in GIMP, select the Pencil Tool (Hotkey N), set your appropriate settings:

  • Color
  • Mode
  • Opacity
  • Brush
  • Size

Usually, for a simple 1 pixel thick line, you can just set Color, Brush: 1 Pixel, and Size: 1.

Click one end of the line. Hold Shift and Click the other end of the line. Done.

(Make sure that you are on the correct layer, the layer is visible, and that you have the correct area selected - if in doubt, select all Ctrl + A).

Michael Plautz

Posted 2011-11-11T16:18:51.613

Reputation: 253

0

The problem I just had, which I quickly solved, was that 'white' was my foreground colour, and I was doing it onto a white background. Seemed as if nothing was happening, though I guess it was, just blonde on blonde.... So just changed the main colour to black, et voila.

Amphibio

Posted 2011-11-11T16:18:51.613

Reputation: 101

0

I just had this issue as well, I think you have to select the path after making it, because when I go to Select->From Path, then Edit->Stroke Path, it works the way I expected it to (a line appears.) I'm a GIMP novice, so perhaps someone else can explain why you need to select the path after making it.

Josh

Posted 2011-11-11T16:18:51.613

Reputation: 1

0

True that using GIMP seems "hard", but after fruitlessly trying the above answer of kbulgrien, I got it done the easy way, like the OP tried. Important point: if you do not see a visible stroke appearing, please check the actual colors you are working with. In my case, I at first did not see a result of "Stroke Path.." because I was painting with the background color!

This little innocent-looking Gimp control has at least 3 "buttons" to click on:

enter image description here

Roland

Posted 2011-11-11T16:18:51.613

Reputation: 299