Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Gimp Plugin: A better lazy man's city?

  1. #1
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Post Gimp Plugin: A better lazy man's city?

    Inspired by the mosaic city building stuff (torstan's tute here, e.g.), I made a script to do the same, but working with something that resembles Voronoi patterns. My understanding of the concept may be lacking, but I've found that radial gradients placed against eachother using lighten only will make for some nice straightish lines when you edge detect it.

    To use, make a b/w map of your streets (streets black, house areas white), then make a selection of the areas you want to populate with houses and activate the plugin (under Filters|Map tools|Generate city)

    I've attached an example where I've made a couple of different areas with different sized buildings and colors.

    Comments and ideas are welcome. I've considered making a setting for increasing the distance between houses.

    Edit: I added the setting for distance between houses.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Alfar; 08-07-2009 at 08:58 AM.

  2. #2

    Post

    looks good.

    Any way you can hollow out the center shapes automatically?

    ie. create courtyards


    Dollhouse Syndrome = The temptation to turn a map into a picture, obscuring the goal of the image with the appeal of cute, or simply available, parts. Maps have clarity through simplification.

    --- Sigurd

  3. #3

    Default

    Moved to the actions forum.

    Nice script (not that I know python). A suggestion is to use the enums provided rather than integers to make the code more readable. Like using FG-BG-RGB-MODE instead of 0.

    -Rob A>

  4. #4

    Default

    OK - noticed a few oddities.

    Instead of undo enable/disable, wrap the plugin code with gimp_image_undo_group_start and gimp_image_undo_group_end. THis will let you "undo" the plugin as one step, as it is now I can't undo the plugin.

    You also leave a layer mask selected at the end. It is nicer to leave a layer selected.

    An option to both merge visible and delete non-visible layers might be useful.

    -Rob A>

  5. #5

    Default

    Looking good Alfar but too regular to my eye and that was the big problem I always came up against with the lazy man's style. But you've solved it for me with that context free script. What I love about it is that with a few tweaks you can create literally thousands of buildings which look simlar but not identical which really helps with a consistency of style.

  6. #6
    Community Leader Facebook Connected Ascension's Avatar
    Join Date
    Jun 2008
    Location
    St. Charles, Missouri, United States
    Posts
    8,392

    Post

    You'll have to take me step by step thru this Ravs cuz I don't know the first thing about using CF...add that it to your tut maybe?
    If the radiance of a thousand suns was to burst at once into the sky, that would be like the splendor of the Mighty One...I am become Death, the Shatterer of worlds.
    -J. Robert Oppenheimer (father of the atom bomb) alluding to The Bhagavad Gita (Chapter 11, Verse 32)


    My Maps ~ My Brushes ~ My Tutorials ~ My Challenge Maps

  7. #7

    Default

    Sure, no worries. Alfar's done all the hard work, it's just changing the odd number here or there. Let me finish this city first and then I'll get on with the full tut. Alfar's the best one to explain the context free end of it though.

  8. #8
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Post

    Quote Originally Posted by Sigurd View Post
    looks good.

    Any way you can hollow out the center shapes automatically?

    ie. create courtyards
    Yes, definately going to be an option. Do you want just one layer of houses, then?

    Quote Originally Posted by RobA View Post
    OK - noticed a few oddities.

    Instead of undo enable/disable, wrap the plugin code with gimp_image_undo_group_start and gimp_image_undo_group_end. THis will let you "undo" the plugin as one step, as it is now I can't undo the plugin.

    You also leave a layer mask selected at the end. It is nicer to leave a layer selected.

    An option to both merge visible and delete non-visible layers might be useful.

    -Rob A>
    I did use undo_group_start and undo_group_end, but I ran into trouble because I'm doing a huge number of gimp_edit_blend, and it just blows away memory on the undo info for some reason. I was going to ask you about that, actually.

    I'll try and fix the selection at the end, and the two options you mention, sure thing.

    I wonder if a house size jitter would help with the uniformity... will have to look into that. Maybe a placement jitter as well? Hmmm...

  9. #9

    Default

    Hmmm. I ran into a similar problem with my multifill script.
    Is there a freeze/thaw call for undo?

    Ultimately the solution I came up with was to copy the active layer then use the paste as new image pdb call, then disable the undo stack on the new image only when all the processing was done I did a copy paste back into the original image (that just has an undo group)

    That might help?

    -Rob A>

  10. #10
    Guild Adept Alfar's Avatar
    Join Date
    May 2009
    Location
    Denmark
    Posts
    276

    Default

    Ah, yes... doing the stuff in a different image would probably do the trick. Will have to play with that. Thanks!

Page 1 of 2 12 LastLast

Posting Permissions

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