# Mapping Resources > Tutorials/How-To >  [Award Winner] Tapered Rivers in GIMP

## RobA

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 that Gimp didn't have tapered strokes  :Frown: 

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  :Razz: 

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..."


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.


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


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


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

Now i feel a new award for RobA will be coming soon  :Smile:  Though i don't use gimp, this is no doubt worthy of a little rep from me sir.

Thanks.

Pat

----------


## ravells

RobA you totally rock.

----------


## Sagenlicht

Would rep you if I could, but at least I can rate the threat  :Smile:

----------


## lisze

Thank you. I will definitely try this out.

----------


## RobA

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

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

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

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

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

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  :Smile:  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

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

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  :Very Happy: 
big thanks for this!!!

#yosh

----------


## BBHoap

Super super dumb question but I'm pretty new to all this.  where do you save the script to?

----------


## RobA

> 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

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  :Smile:  

#yosh

----------


## RobA

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

Thanks !

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

#yosh

----------


## Nauryl

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  :Smile:

----------


## RobA

> 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/sh...g-River-How-To

but it is simpler now with path effects.

-Rob A>

----------


## mramshaw

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

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_im...exmap_aged.jpg

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

----------


## akaddk

I've tried this a dozen different ways a dozen times each and yet can't replicate your results. Using the 'default' settings with a path that only has two nodes, I'm constantly getting 'splotches' where the tapering sort-of resets slightly. The effect ends up making it look like several tapered lines joined together. I have no idea what I'm doing wrong  :Frown:

----------


## Evocati

I'm not having any luck in getting this to work.  I drew my line with my pencil, used fuzzy select to pick the river(s), switched to brush then ran the script (values: 1, 3, 20, .5) and the line didn't do anything.  Any suggestions?

----------


## johnvanvliet

*Hi* Evocati  
you do know that the script-foo script in the first post is 7 years old and out of date
and is for a ANTIQUE version of the Gimp that is and has not been supported in well 7 YEARS 

think of it this way 

you have a brand new  64 bit windows 10 install

this is a 32 bit windows XP program 

-- will not work out well 

in 2008 the version of gimp was 2.1 

now in 2015 it is 2.8.14 and will soon be Gimp 3.0 
back a few YEARS the gimp 2.4 code was tossed in the trash and rewrote into 2.6 and 2.8 to become the soon to be released Gimp 3.0 

code for gimp 2.1 will NOT work in the current Gimp 2.8.14 

also the GUI and the tool options are also now rather DIFFERENT than back in 2008 and gimp 2.1

but it sort of works 
use the path tool to set a path then "select path "
but it is NOT a taper 

the NEWER ( was not in gimp 2.1 ) ink well pen tool will taper a line as you draw

----------


## Evocati

That analogy doesn't work, but I get it; coding for gimp has changed significantly enough that this script no longer functions.

I'll give the ink pen a shot.  Frankly, it sounds like I need to get a Syntec or something :-/  Thanks for the fast response, as well.  I was kinda wondering if anyone was going to say anything since the thread was kinda old.

Thank you :-)
 ~Evo.

----------


## HBrown

> *Hi* Evocati  
> you do know that the script-foo script in the first post is 7 years old and out of date
> and is for a ANTIQUE version of the Gimp that is and has not been supported in well 7 YEARS


I use this script in 2.8.14.  I think if you cannot use it, something else is wrong.

----------


## StillnessTolls

Hey RobA, I'm a little confused about using the script. In your tut you say to use the pen tool, do you mean the pathing tool? I don't think I'm  using it properly because my path doesn't do anything after I switch to the paintbrush tool. (I just started using gimp today so it's been a little confusing)

Edit: Ah I just read through the last page, sad to see this doesn't work so well anymore. I'll try to figure out the ink tool, hopefully it will create a similar tapering effect.

----------


## RobA

> Hey RobA, I'm a little confused about using the script. In your tut you say to use the pen tool, do you mean the pathing tool? I don't think I'm  using it properly because my path doesn't do anything after I switch to the paintbrush tool. (I just started using gimp today so it's been a little confusing)
> 
> Edit: Ah I just read through the last page, sad to see this doesn't work so well anymore. I'll try to figure out the ink tool, hopefully it will create a similar tapering effect.


As a followup- I do all my rivers with a pressure sensitive tablet using size dynamics and smoothing with the gimp ink tool.   If I only had a mouse, I would use Inkscape with path effects to get a tapered stroke.

-Rob A.

----------

