PDA

View Full Version : [Award Winner] Tapered Rivers in GIMP



RobA
09-26-2008, 12:12 PM
There have been many questions in the past on tapering rivers in Gimp... I stated in this tutorial on making rivers with a mouse in photoshop (http://www.cartographersguild.com/showthread.php?p=32743) that Gimp didn't have tapered strokes :(

SO I wrote a little script-fu to do it!

This isn't so much a tutorial, as a posting of a new script. It ain't too fast, but it works :P

Just unzip the attachment at the end, and save the script into your normal spot.

Draw a path using the pen tool, then switch back to the paintbrush tool (the script strokes with the active tool, so you could even, for example, erase tapered strokes). The script registers under the Edit menu as "Tapered Stroke Path..."
6661

The dialog allows you to select the start width, end width, spacing (20 percent is a good default, but by setting it to 100 you get a string of pearls effect), and a parameter called "Taper Exponent". This control the rate of taper. At 1, the taper is linear from the start to the end. At values less than 1 the taper changes faster, and greater than 1 the taper changes slower (nearer the end). I set the default at 5, which seems good for rivers.
6662

Here is the result after stoking in black with the defaults. I have turned on the path visibility to show how it lines up:
6663

And since I have one more attachment, here is the image:
6664

Couple of things... It will only stroke the first segment of a multi (broken) segmented path. If there are no paths, the script will run but error out.

Hope people find this one useful!

-Rob A>

Patrakis
09-26-2008, 04:03 PM
Now i feel a new award for RobA will be coming soon :) Though i don't use gimp, this is no doubt worthy of a little rep from me sir.

Thanks.

Pat

ravells
09-27-2008, 06:16 PM
RobA you totally rock.

Sagenlicht
09-28-2008, 07:04 AM
Would rep you if I could, but at least I can rate the threat :)

lisze
03-07-2009, 09:52 AM
Thank you. I will definitely try this out.

RobA
03-07-2009, 01:27 PM
Lizse - Since 2.6 gimp supports some basic tapering when stroking along paths, but this script still gives a bit more flexibility.

-Rob A>

Torq
03-12-2009, 10:08 AM
I've only just seen this script now. Thanks Rob, it will save me a fortune of time. Actually it would have saved me a whole lot more time if I had looked at it before doing the rivers on my challenge entry this month. Served me right for going to sleep.

Torq

heathan666
06-03-2009, 06:34 PM
Ya I'm using the script and I've used some others from you RobA but I seem to keep getting an error message saying invalid path.
Now I looked and I noticed that in the Path to Stroke entry mine always says empty....what am i doing wrong?

RobA
06-03-2009, 09:49 PM
Have you drawn a path using the path tool first?

Once that is done you need to select it with the drop-down of the field.

-Rob A>

heathan666
06-04-2009, 06:45 PM
yay that's awesome, no I didn't do that because I didn't know that was a tool, that's pretty kewl, guess you do learn something new every day.

koewn
02-06-2010, 11:52 PM
Silly question.

I'd drawn my river with a 1 point pencil, did an alpha-to-selection on a "Rivers" layer, saved that selection to a path.

The script goes up one side of the selection and down the other - negating any taper.

Update - when I woke up, I finally thought to zoom in on the path, and sure enough, the path is the selection as promised :) It goes around my 1px line.

Update 2 - the power of Google compels me to report that Ctrl-Shift click on a path node or segment deletes said target. Somewhat tedious, but I reduced my path to a line rather than an enclosed shape, and now it works as expected.

FWIW I was doing it this way because I didn't feel like I was getting the right sort of squiggly lines for the rivers doing a path with the path tool - too much clicky to make enough nodes that I could squiggle it out.

Thanks!

Koewn

RobA
02-07-2010, 08:51 PM
There a couple things to help.. I have a fractalize path script. There is also a smooth path script that takes a straightline path and connects the nodes with smooth lines. After that, the tapered stoke works quite well.

-Rob A>

yosherl
08-06-2010, 03:07 AM
Wahh
This "Draw a path using the pen tool" takes me 2 hours to understand... args
Thanks for the Script its really great if one can read :D
big thanks for this!!!

#yosh

BBHoap
08-12-2010, 11:40 PM
Super super dumb question but I'm pretty new to all this. where do you save the script to?

RobA
08-13-2010, 12:52 AM
Super super dumb question but I'm pretty new to all this. where do you save the script to?

Depends on the OS and gimp version. If XP and gimp 2.6.something, save it (keeping the .scm extension) in "\Documents and Settings\<user-name>\.gimp-2.6\scripts\"

-Rob A>

yosherl
08-13-2010, 06:42 AM
Hi RobA!

can you tell me how you use this script? I've create 44 paths in my map because for me this seems to be the only solution for my problem
I try to have realistic looking rivers so I create for a river look like a Y with 3 paths. 1 path for every line.
Then I use the script and the "upper rivers" grow f.e. from 1px to 3px. The "vertical river" starts with 6 or 7 px and end up with 10px.

Hopefully you know what I mean :)

#yosh

RobA
08-13-2010, 12:10 PM
I have always used one path fir the main river then added branches.

So instead of 3 paths making a Y, I have one main path and a second branch path.


If that makes sense.

-Rob A>

yosherl
08-14-2010, 11:15 AM
Thanks !

If I ever finish my map, I post it, promised :)

#yosh

Nauryl
01-05-2011, 09:52 AM
I'm actually looking for the same technique in Inkscape. I do it totally different, here's how:

Create the path for the river, then set up the Paintbrush tool to use a fuzzy circle brush, turn on "Fade out", and stroke the path with the Paintbrush tool. All I need to do is to play with the Fade out value, and then remove the fuzziness by playing with the Value curve in Color > Curves.

Anyways, the script is great :)

RobA
01-05-2011, 10:10 AM
I'm actually looking for the same technique in Inkscape. I do it totally different, here's how:

Create the path for the river, then set up the Paintbrush tool to use a fuzzy circle brush, turn on "Fade out", and stroke the path with the Paintbrush tool. All I need to do is to play with the Fade out value, and then remove the fuzziness by playing with the Value curve in Color > Curves.

Anyways, the script is great :)

Clever idea with a fuzzy brush/fadeout and curves.

In Inkscape I sued to use: http://www.cartographersguild.com/showthread.php?2338-Award-Winner-Inkscape-Tapering-River-How-To

but it is simpler now with path effects.

-Rob A>

mramshaw
04-10-2011, 11:55 PM
RobA, I learned of you over at MeetTheGimp.org and I'm very happy I registered here
as I can now download some of your great GIMP scripts. This one looks like another
winner! Thanks.

Insufficient Metal
04-12-2011, 02:00 PM
Just wanted to say thank you for the great tutorial. I was struggling with my rivers in Inkscape, just making crappy freehand lines, until I found this tutorial. Now I'm much happier with how they turned out:

http://cdn.obsidianportal.com/map_images/410716/eladria_hexmap_aged.jpg

Still a work in progress, but an order of magnitude nicer than what I had! Thanks so much!