Page 1 of 3 123 LastLast
Results 1 to 10 of 21
Like Tree1Likes

Thread: Random Density Map GIMP Script

  1. #1
      RobA is offline
    Administrator RobA's Avatar
    Join Date
    Apr 2007
    Location
    Niagara, Canada
    Posts
    5,556

    Info Random Density Map GIMP Script

    As hinted here I have been working on a gimp script to draw with the active brush using a "density map" to determine the probability of painting.

    Attached is a zip. Just drop it in the gimp script directory.

    Here is where it registers in the menu:
    Random Density Map GIMP Script-menu.png

    Do use it in the most basic way, create a probability density map.... a layer where back will have a 0% chance of drawing and white will have a 100% change of drawing:
    Random Density Map GIMP Script-map1.png

    Create a new layer (it must be the same size) to draw on with the current brush.

    Here is the dialog:
    Random Density Map GIMP Script-dialog.png

    and one result with a red Hexagonal 21 px brush, and set it at 100% Density, Spacing of 21 px, and no Jitter:
    Random Density Map GIMP Script-1-nojitter.png

    (more examples following...)
    Attached Files Attached Files

  2. #2
      RobA is offline
    Administrator RobA's Avatar
    Join Date
    Apr 2007
    Location
    Niagara, Canada
    Posts
    5,556

    Post

    Using the same Density map, here are more results:

    Setting the density to 50% will make white only have a 50 chance of drawing. Here again with no jitter:
    Random Density Map GIMP Script-2-nojitter_50percent.png

    And back at 100%, but with a jitter of 1. The jitter value is a scale of the spacing parameter, for randomly displacing the x&y directions, to get rid of the grid look:
    Random Density Map GIMP Script-3-jitter.png

    The scrip draws left to right and top to bottom, to work with isometric image brushes, like the trees posted:
    Random Density Map GIMP Script-4-trees.png

    And using the "invert" check will invert the map (black = 100% chance and white = 0% chance):
    Random Density Map GIMP Script-5-trees_invert_map.png

    (cont...)

  3. #3
      RobA is offline
    Administrator RobA's Avatar
    Join Date
    Apr 2007
    Location
    Niagara, Canada
    Posts
    5,556

    Post

    The other option is less useful for mapping but might have some artistic uses...

    You can use a map with transparency, and it will use the alpha as the density map, and the colour as the colour to paint with.

    Here is such a density map:
    Random Density Map GIMP Script-map2.png

    and the result, using the hex brush again:
    Random Density Map GIMP Script-map2_result.png

    Enjoy!

    -Rob A>

  4. #4
      ravells is offline
    Community Leader Gracious Donor ravells's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    10,905

    Default

    Rob that is phenomenal! I wonder if it's possible to write a script that does this in photoshop?

  5. #5
      Ghalev is offline
    Publisher Ghalev's Avatar
    Join Date
    Jun 2008
    Location
    Colorado
    Posts
    100

    Praise

    Excellent and useful stuff.

    S. John Ross Ghalev
    Who Dat? Games Fonts Uresia

  6. #6
      jfrazierjr is offline
    Community Leader jfrazierjr's Avatar
    Join Date
    Oct 2007
    Location
    Apex, NC USA
    Posts
    2,963

    Default

    The drool is running down my chin as I type. This is GREAT. I can't wait to try it out.

    Joe
    My Finished Maps
    Works in Progress(or abandoned tests)
    My Tutorials:
    Explanation of Layer Masks in GIMP
    How to create ISO Mountains in GIMP/PS using the Smudge tool
    ----------------------------------------------------------
    Unless otherwise stated by me in the post, all work is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.

  7. #7
      su_liam is offline
    Guild Artisan su_liam's Avatar
    Join Date
    Aug 2007
    Location
    Port Alberta, Regina(IRL: Eugene, OR)
    Posts
    711

    Default

    Cool. I'll have to try this. It looks like you might be able to use the alpha-and-color option to cause interesting variation in tree(or mountain or whatever) color. For instance, with trees, create a layer with a narrow variation of green shades. (Possibly use a greyscale fractal and gradient map with a narrow gradient(say dark green to light green)).

    Another idea I have is to make an initial color layer that varies only in hue and saturation, and apply a variation in value by multiplying with the shaded relief from an HF.

    Then you paint in your desired forest density in alpha.

    Might be a good way to add an interesting forest texture to a shaded relief map.

    I was initially thinking of using top-down trees for a realistic look, but I think this might work best all symbolical, with iso trees simply as a symbol saying, "forest here."


    If nothing else, this is making GIMP look like a more and more viable alternative to CC for "symbol"-type maps.
    Last edited by su_liam; 07-07-2008 at 01:46 PM.

  8. #8
      RobA is offline
    Administrator RobA's Avatar
    Join Date
    Apr 2007
    Location
    Niagara, Canada
    Posts
    5,556

    Default

    One limitation is that it doesn't respect active brush scaling, so all images are drawn at the original scale of the selected brush. Initially, I hoped to have an options to paint smaller versions based on the density map, but dynamic brush scaling isn't exposed in the scripting API (yet).

    -Rob A>

  9. #9
      Karro is offline
    Guild Artisan Facebook Connected
    Join Date
    May 2008
    Location
    Atlanta, Georgia, United States
    Posts
    928

    Post

    Oh my... this is very cool... an excellent tool!

  10. #10
      Torq is offline
    Community Leader Torq's Avatar
    Join Date
    Jun 2007
    Location
    Cape Town, South Africa
    Posts
    902

    Post

    I agree. Great tool Rob, I'm going to try it as soon as possible.

    Torq
    The internet! It\'ll never catch on.

    Software Used: Terranoise, Wilbur, Terragen, The Gimp, Inkscape, Mojoworld

Page 1 of 3 123 LastLast

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
  •