It is currently 21 Jan 2018, 18:13

GIMP Python Fu ScriptsRender Forest Script for GIMP (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 2071
Joined: 25 Sep 2016, 17:16
Cash on hand: 7,180.19 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1106
x 240
Contact:
Canada

Render Forest Script for GIMP

Post#1 by tim » 16 Jul 2017, 10:44


This script generally follows this tutorial: https://www.cartographersguild.com/show ... hp?t=10009
minus individual trees. I just uses the "Small Sized Forests" pattern from tutorial. You must have that pattern installed

:download:
render_forest.zip #
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(1.98 KiB) Downloaded 35 times
:download:
render_forest (2).zip #
version 2. dense forest toggle option.
(2.06 KiB) Downloaded 12 times
:download:
render_forest (3).zip #
version 3. more scritped improvement steps.
(2.29 KiB) Downloaded 15 times
:download:
render_forest (4).zip #
version 4. allow user to select custom pattern instead of the dense/not dense forest choice.
(2.41 KiB) Downloaded 23 times

Script Menu Location: Python-Fu/Render Forest

Instructions:
1. Have your blank image or opened map image.
2. On a transparent layer, use pure black to draw where you want forest(s) to generally be at. Name the layer "Forest Start".
3. Run Script (Python-Fu/Render Forests).
4. Let the magic happen.

Sample input and result.
Image with a transparent layer with forests defined as pure black areas.
black_on_transparent_layer_to_represent_forests.png
black_on_transparent_layer_to_represent_forests.png # (337.4 KiB) Viewed 499 times (Watermarked | Thumbnail)
result.
resulting_forests.png
resulting_forests.png # (421.83 KiB) Viewed 499 times (Watermarked | Thumbnail)
less_dense_2.png
less_dense_2.png # (468.51 KiB) Viewed 448 times (Watermarked | Thumbnail)
Some additional steps to improve map
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
No avatar
themantheycallcris
Forum Member
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 6
Joined: 17 Aug 2017, 17:23
Cash on hand: 83.16 GLP
x 2
x 1
Gimp Nation

Post#2 by themantheycallcris » 17 Aug 2017, 17:29


Would you be able to add a GUI option to choose the pattern one uses for this? Maybe default it to the small forest one, but allow folks to change it if they want?
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 2071
Joined: 25 Sep 2016, 17:16
Cash on hand: 7,180.19 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1106
x 240
Contact:
Canada

Post#3 by tim » 18 Aug 2017, 10:42


Ok i added options for that in version 4.
1 x



aka Tin
Image gimplearn.net                                              

No avatar
themantheycallcris
Forum Member
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 6
Joined: 17 Aug 2017, 17:23
Cash on hand: 83.16 GLP
x 2
x 1
Gimp Nation

Post#4 by themantheycallcris » 18 Aug 2017, 17:28


For some reason I keep getting this error (with any version I've tried to use):

Traceback (most recent call last):
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 736, in response
dialog.res = run_script(params)
File "/usr/lib/gimp/2.0/python/gimpfu.py", line 361, in run_script
return apply(function, params)
File "/home/onecall/.gimp-2.8/plug-ins/render_forest.py", line 45, in python_tt_render_forest
pdb.gimp_image_select_color(image,CHANNEL_OP_REPLACE,forest_start,(0,0,0))
RuntimeError: Procedure 'gimp-image-select-color' has been called with an invalid ID for argument 'drawable'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.


Can you help? Let me know what other info you might need to help me get this figured out.
0 x




No avatar
themantheycallcris
Forum Member
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 6
Joined: 17 Aug 2017, 17:23
Cash on hand: 83.16 GLP
x 2
x 1
Gimp Nation

Post#5 by themantheycallcris » 18 Aug 2017, 17:31


I completely closed GIMP, fired it new, created a new 8.5x11 transparency, renamed it Forest Start, painted with black only, ran the script, got the error...
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 2071
Joined: 25 Sep 2016, 17:16
Cash on hand: 7,180.19 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1106
x 240
Contact:
Canada

Post#6 by tim » 18 Aug 2017, 20:44


i can't reproduce error on my computer. What GIMP are you using? I am on GIMP 2.8.22 (Not sure if it makes a difference or not).
0 x



aka Tin
Image gimplearn.net                                              

User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 6/12
Posts: 2071
Joined: 25 Sep 2016, 17:16
Cash on hand: 7,180.19 GLP
Bank: 42,250.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1106
x 240
Contact:
Canada

Post#7 by tim » 19 Aug 2017, 10:57


I managed to reproduce the error when there's no layer named "Forest Start" (case sensitive)... You must have layer named "Forest Start" exactly otherwise it'll show that error. maybe you misspelled "Forest Start" or "wrong case" or something like that.
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

Farmer (2), User avatar PhotoMaster (1), Gioanvm (2), User avatar gnerd (4), User avatar tim (50), User avatar RJKD (8), themantheycallcris (20), User avatar Pat625 (2), User avatar Conbagui (3), User avatar Steve Reid (5)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: Issabella
2: david
3: animicule
4: Issabella
5: gnerd
6: Issabella
7: Ella

Who is online

Users browsing this forum: No registered users and 3 guests