Results 1 to 23 of 23

Thread: Gimp Script: Fractalize Path

  1. #1

    Post Gimp Script: Fractalize Path

    A follow-up on Cool as a Cucumber's question about making fractal lines in Gimp 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:
    Click image for larger version. 

Name:	frac_demo1.jpg 
Views:	1309 
Size:	200.4 KB 
ID:	15232Click image for larger version. 

Name:	frac_demo2.jpg 
Views:	711 
Size:	112.9 KB 
ID:	15233

    And a sample of making a quick map with rivers:
    Click image for larger version. 

Name:	frac_demo3.jpg 
Views:	1247 
Size:	222.3 KB 
ID:	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>
    Attached Files Attached Files

  2. #2

    Default

    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!

  3. #3
    Guild Artisan Facebook Connected
    Join Date
    May 2008
    Location
    Atlanta, Georgia, United States
    Posts
    928

    Post

    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!
    I think, therefore I am a nerd.
    Cogito, ergo sum nerdem.

    Check out my blog: "The Undiscovered Author"
    It's the story of a writer... follow me in my simple quest to get published, and share your own writing stories, adventures and writerly tips.

    Pimping my worldmap here. Still WIP... long way to go, but I'm pretty proud of what I've done so far...

  4. #4
    Guild Novice
    Join Date
    Jul 2009
    Location
    Seattle, WA
    Posts
    17

    Post

    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.

  5. #5
    Guild Journeyer
    Join Date
    Oct 2007
    Location
    Sunshine Coast, BC, Canada
    Posts
    134

    Default

    I have been waiting for this... Thank you!

  6. #6
    Guild Journeyer msa's Avatar
    Join Date
    May 2009
    Location
    New York, NY
    Posts
    249

    Post

    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

  7. #7

    Post

    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?

  8. #8
    Guild Journeyer altasilvapuer's Avatar
    Join Date
    Mar 2009
    Location
    Augusta, GA
    Posts
    194

    Default

    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

  9. #9

    Post

    Great Scrip. Repped XD

    My work is under CC licences, you can see wich one apply in the work itself, if there is no CC logo, you can assume is an: Attribution-Noncommercial-Share Alike 3.0 Unported licence

    Need more rights, just mail me and we can chat about it.

  10. #10

  11. #11
    Guild Applicant
    Join Date
    Feb 2012
    Location
    L.A.
    Posts
    4

    Default

    Question: which GIMP versions is the script compatible with? and where does the file go? (GIMP help isn't being especially helpful there) Thanks.

  12. #12

    Default

    Quote Originally Posted by Beaumains View Post
    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>

  13. #13
    Guild Applicant
    Join Date
    Feb 2012
    Location
    L.A.
    Posts
    4

    Default

    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.

  14. #14

    Default

    This works perfectly! I used the maximum number of subdivisions and smoothness of 5. I also used your GIMP guide to creating an artistic regional map to create fractalized shores. Thanks!

  15. #15

    Default

    Quote Originally Posted by RanDomino View Post
    This works perfectly! I used the maximum number of subdivisions and smoothness of 5. I also used your GIMP guide to creating an artistic regional map to create fractalized shores. Thanks!
    Glad you found it useful!

    -Rob A>

  16. #16
    Guild Novice
    Join Date
    Sep 2014
    Location
    Boston area
    Posts
    23
    Blog Entries
    1

    Default

    This is lovely! If you start with a big continent- or world-level map, you can then take a subsection of the base layers and fractalize them, producing progressive detail without having to re-draw the basics.

  17. #17
    Guild Artisan
    Join Date
    Sep 2014
    Location
    Paris & Berlin
    Posts
    610

    Default

    This is a great idea - if I had found this thread earlier, I would spare hours of creating fractals elsewhere and importing them in GIMP.
    However I can't make the script work - I copied the script in the right directory, refreshed fu scripts but when I right click on a path, I get the usual huge menu with submenus but there is nowhere "fractalize path".
    How to make it work ?

    EDIT : I just checked with the procedure browser in GIMP and the procedure fractalize path appears as temporary procedure. So it's there. But I am still unable to find in what menu it is hiding.
    Last edited by Deadshade; 12-11-2014 at 12:15 PM.

  18. #18
    Guild Expert johnvanvliet's Avatar
    Join Date
    Jul 2012
    Location
    N 42.39 W 83.44
    Posts
    1,091
    Blog Entries
    4

    Default

    in the current Gimp 2.8.14
    the menus are a bit different than in 2.4 and 2.6

    a lot has changed in the last 5 years

    but it is there and works

    select the path tool
    make a test roundish path ( 6 or 7 clicks will do )
    then on the top menu click "window" and select " docable dialogs" and select "path"

    on the bottom of that window is the script

    it dose work in my Gimp install on OpenSUSE linux
    ( a source build from the current stable branch)

    mind you i did NOT expect this to work after 5 years , but it dose
    --- 90 seconds to Midnight ---
    --------

    --- Penguin power!!! ---


  19. #19
    Guild Artisan
    Join Date
    Sep 2014
    Location
    Paris & Berlin
    Posts
    610

    Default

    OK thanks, found it. Actually when the path window is selected, one has to reclick on the window button (top right), select path menu and there at the end is the command fractalize path.
    What is unpleasant is that the fractalize path window opens underneath the GIMP Window so that it can't be seen.

  20. #20
    Guild Expert johnvanvliet's Avatar
    Join Date
    Jul 2012
    Location
    N 42.39 W 83.44
    Posts
    1,091
    Blog Entries
    4

    Default

    it will
    the script is using 5 year old depracated gtk2 commands

    the 2,8 branch of gimp made MANY and some VERY DRASTIC a changes in preparation for The Gimp 3.0
    the fact that is still works is just random chance

    the tool window will open under the rest of the windows until the script is updated
    --- 90 seconds to Midnight ---
    --------

    --- Penguin power!!! ---


  21. #21

    Default

    I am writing in mid-2016 to confirm that this script *STILL* works as intended. Unbelievable. Thank you! I stopped my five year lurking today simply to thank you for this life-saver. The staying power of this script is legendary.
    Last edited by Gloomshroud; 06-23-2016 at 01:13 PM.

  22. #22
    Guild Journeyer eepjr24's Avatar
    Join Date
    Nov 2020
    Location
    East Coast, USA
    Posts
    150

    Default Can it be revived?

    Quote Originally Posted by Gloomshroud View Post
    I am writing in mid-2016 to confirm that this script *STILL* works as intended. Unbelievable. Thank you! I stopped my five year lurking today simply to thank you for this life-saver. The staying power of this script is legendary.
    So I was trying to get this to work in Gimp 2.10.22 and I am not having much success. I can see the temp procedure in the Script-Fu Console but I don't know enough about GIMP to guess the parameters. Is there anything I can do to work on a port or get the existing code to execute? I am pretty decent at translating things between languages if someone can point me to the source code or give me a nudge in the right direction?

    Belay the above. After I got ScriptFu set up correctly it works just fine. So, confirmed working in 2.10.22.

    - E
    Last edited by eepjr24; 11-11-2020 at 09:38 PM. Reason: Corrected

  23. #23

    Default

    If we are already talking about scripts, please tell us what languages you need to know to write them. I'm currently learning React.JS and Node.JS ProCoders. Can they be useful?
    Last edited by kennystone; 08-11-2021 at 03:50 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •