PDA

View Full Version : Gimp Script: Fractalize Path



RobA
07-28-2009, 02:58 PM
A follow-up on Cool as a Cucumber's question about making fractal lines in Gimp (http://forum.cartographersguild.com/showthread.php?t=6267) I once again pulled on my coder hat and, stealing liberally from the inkscape fractalize extension and Isomage's random cave script (thanks for the gaussian random number generator!), proceeded to duct tape a script together!

This script will take the active path and fractalize it, using a random midpoint displacement algorithm, with the displacement proportionate to the length between nodes. Also the nodes don't move.

Parameters are:
Subdivisions - number of iteration to divide each segment in half... so for a value of 3 the line between two nodes is replaced by 8 new lines.
Method - Uniform or Gaussian... the distribution of the displacement.
Smoothness - Higher = less displacement, lower = more displacement.
Interpolate First - Not checked, it will subdivide between nodes. Checked, it will walk the path and create new evenly spaced noted. These nodes will not likely line up with existing nodes, so is not great for accurate replacement, but is super for fractalizing a smooth shape, or a path created from a selection.
Interpolate Pixel Spacing - if Interpolate First is checked, the spacing to use.
Create New Path - if checked, it creates a new path. If unchecked, it replaces the active path.

Here a few examples with the black line a stroke of the original path, and the red after fractalizing:
1523215233

And a sample of making a quick map with rivers:
15234

Attached is a zip of the script. I have debugged it fairly well (doesn't seem to crash anymore ;) ) but there could still be issues.

The script creates a new entry in the path dialog menu, so right click on a path and select "Fractalize path"


-Rob A>

ravells
07-28-2009, 03:10 PM
I have no idea what you just said but the results look really cool. It must be amazing to have the knowledge and talent to tweak Gimp to do what you want it to. Rep to Roba!

Karro
07-28-2009, 04:06 PM
I believe I will be downloading this one and adding it to my GIMP repetoire as soon as I get to a computer with GIMP on it.

This looks very useful and cool!

Aidan
07-28-2009, 05:07 PM
Awesome. Have some Rep.

It occured to me that several of the steps of your regional map making tutorial could be scriptified as well. Maybe I'll try to learn script-fu.

Lathorien
07-28-2009, 05:59 PM
I have been waiting for this... Thank you!

msa
07-28-2009, 08:39 PM
Awesome. When I was reading Cool's thread, I thought about trying to learn myself some Script-Fu doing just this. Now I'm out a project, but its great to have the script! Great work :)

Ghostman
07-29-2009, 06:04 AM
Downloaded and repped! For a long time I've been wishing that GIMP had this feature. Maybe you could contact the developers and try to have your script added to future official releases?

altasilvapuer
10-02-2009, 12:43 PM
You know, I may just have to start using GIMP for a lot more of my mapping, if you keep churning these out, Rob. Kudos!

-asp

zenram
10-02-2009, 11:55 PM
Great Scrip. Repped XD

RobA
10-03-2009, 01:43 PM
I'm actually hoping ijontichy will turn this into a C plugin, and combine it with a bunch of other possible path manipulations as a big set of path plugins...

-Rob A>

Beaumains
03-24-2012, 02:33 PM
Question: which GIMP versions is the script compatible with? and where does the file go? (GIMP help isn't being especially helpful there) Thanks.

RobA
03-24-2012, 07:35 PM
Question: which GIMP versions is the script compatible with? and where does the file go? (GIMP help isn't being especially helpful there) Thanks.

It should work with 2.6 and later. What is your OS? That will determine the location.....

But generally: http://docs.gimp.org/en/install-script-fu.html

-Rob A>

Beaumains
03-24-2012, 11:26 PM
Thanks Roba, looks like it's working now; I was just wary of putting the file in the wrong place; GIMP doesn't seem to have an integrated method of redirecting or reappropriating files. I'm using Win 7, GIMP 2.6.11. I moved it to C:\Users\[Username]\.gimp-2.6\scripts, and it seems to be working right. Thanks for writing this up! Rep'd.