Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,646
» Latest member: iMott
» Forum threads: 7,187
» Forum posts: 39,257

Full Statistics

Latest Threads
Just Erase the Background...
Forum: General questions
Last Post: rich2005
37 minutes ago
» Replies: 4
» Views: 30
Eraser Stopped Working
Forum: General questions
Last Post: Ofnuts
48 minutes ago
» Replies: 11
» Views: 350
Can not make bookmarks fo...
Forum: Installation and usage
Last Post: Ofnuts
Yesterday, 10:14 PM
» Replies: 3
» Views: 126
Save & Export?
Forum: General questions
Last Post: Ofnuts
Yesterday, 10:10 PM
» Replies: 1
» Views: 88
Bookmarks are not saved
Forum: Linux and other Unixen
Last Post: Ofnuts
Yesterday, 09:55 PM
» Replies: 3
» Views: 103
scriptfu could says what ...
Forum: Scripting questions
Last Post: rich2005
Yesterday, 12:01 PM
» Replies: 2
» Views: 139
adding UnitComboBox to a ...
Forum: Scripting questions
Last Post: Ofnuts
Yesterday, 07:05 AM
» Replies: 1
» Views: 103
Gimp make jpg to Webp 100...
Forum: General questions
Last Post: estatistics
02-24-2025, 09:30 PM
» Replies: 8
» Views: 292
select outline
Forum: General questions
Last Post: sallyanne
02-24-2025, 02:38 AM
» Replies: 2
» Views: 127
I can't edit a path
Forum: General questions
Last Post: Ofnuts
02-23-2025, 08:38 AM
» Replies: 2
» Views: 145

 
  dynamics not working in gimp-drawable-edit-stroke-item
Posted by: jonker - 02-28-2024, 09:53 PM - Forum: Scripting questions - Replies (6)

I want to draw perpendicular lines to a path within a selection. This can be done in gimp by selecting the right brush with the correct settings and then stroking a path with the the paintbrush or pencil. When I try to use the same settings in python-fu the stroked portion simply stays vertical. I have noted that during the manual stroke selection there is an "Emulate brush dynamics" option which is selected. I cannot find a similar setting in the python-fu api.
There might be some other issues in the script since this is my second python-fu script:

Code:
#!/usr/bin/env python

# GIMP Python plug-in template.

from gimpfu import *

def hay_selection(img, layer) :
    gimp.progress_init("Finding next tree ring " + layer.name + "...")

    # Set up an undo group, so the operation will be undone in one step.
    pdb.gimp_undo_push_group_start(img)

    # Do stuff here.
    pdb.gimp_context_push()
    # Base grey color
    pdb.gimp_context_set_foreground(gimpcolor.RGB(224,224,224))
    pdb.gimp_drawable_edit_fill(layer, FOREGROUND_FILL)
    # Path around selection
    pdb.plug_in_sel2path(img, layer)
    np = pdb.gimp_image_get_active_vectors(img)
    pdb.gimp_context_set_foreground(gimpcolor.RGB(0,0,0))
    pdb.gimp_context_set_paint_method("gimp-paintbrush")
    pdb.gimp_context_set_brush("2. Block 03")
    pdb.gimp_context_set_dynamics("Track Direction")
    pdb.gimp_context_set_brush_aspect_ratio(-20)
    pdb.gimp_context_set_brush_size(15)
    pdb.gimp_context_set_brush_angle(0)
    pdb.gimp_context_set_brush_spacing(10)
    pdb.gimp_context_set_brush_hardness(1)
    pdb.gimp_context_set_stroke_method(1)
    pdb.gimp_message("Dynamics: " + pdb.gimp_context_get_dynamics())
    pdb.gimp_drawable_edit_stroke_item(layer,np)
    # Fill interior with Hay Small
    pdb.gimp_context_set_pattern("Hay Small")
    pdb.gimp_selection_shrink(img,7)
    pdb.gimp_drawable_edit_fill(layer, PATTERN_FILL)    

    # Cleanup
#    pdb.gimp_image_remove_vectors(img,np)
    pdb.gimp_context_pop()

    # Close the undo group.
    pdb.gimp_undo_push_group_end(img)

register(
    "python_fu_hay_selection",
    "Selection to Hay",
    "Adds edge and fill to selection for hay.",
    "jonker",
    "jonker",
    "2024",
    "<Image>/Python-Fu/Selection to Hay...",
    "*",      # Alternately use RGB, RGB*, GRAY*, INDEXED etc.
    [],
    [],
    hay_selection)

main()

Print this item

  current folder in plugin
Posted by: gimpygirl - 02-28-2024, 06:46 PM - Forum: Scripting questions - Replies (14)

Hi

When I call an existing plugin installed in my own plugin, how can I specify the "current folder", which is the folder the gimp file is in?
See "???"


pdb.python_fu_ofn_export_layers(timg, "???", "{numUp0}.png", "-", 0)

Print this item

  python console
Posted by: gimpygirl - 02-28-2024, 05:29 PM - Forum: General questions - Replies (9)

Hi

What exactly can the python console do in gimp and for what do you use it?
Is there any docs?

A small example of its usage would be great!

Print this item

  procedure not found
Posted by: robgab - 02-28-2024, 05:11 PM - Forum: Scripting questions - Replies (1)

Good day to everybody...
I'm trying to call a G'MIC pluging from a pyhon-fu plugin with the following line:

pdb.gimp_run_procedure("script_fu_engrave", [image, layer])

The script I'm trying to call is:

(define (script_fu_engrave image drawable)
  (plug-in-gmic-qt RUN-NONINTERACTIVE image drawable 0 0 "fx_engrave 0.04,40,0,2,45,-1,1,0,10,1,0,0,0,1,0,50,50")
)
(script-fu-register "script-fu-engrave"
                    "<Image>/Filters/Custom/Engrave"
                    "Apply the Engrave filter"
                    "Your Name"
                    "Your Name"
                    "2024"
                    ""
                    SF-IMAGE "Image" 0
                    SF-DRAWABLE "Drawable" 0)

Script and plugin are into the right directories but the code return to me the following error:

Traceback (most recent call last):
  File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 741, in response
    dialog.res = run_script(params)
  File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 362, in run_script
    return apply(function, params)
  File "C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins\GammaCorr1.py", line 66, in python_fu_custom_function
    pdb.gimp_run_procedure("script_fu_engrave", [image, layer])
error: procedure not found

I spent a full day to try to fix it and I am very frustrated... Is there someone who kindly help me?

Print this item

  ofnuts request script
Posted by: gimpygirl - 02-28-2024, 05:39 AM - Forum: General questions - Replies (3)

Hi

This is for ofnuts: are you interested in adding a script to your collection that is doong the same as this?

https://www.gimp-forum.net/attachment.php?aid=11260

Then I could always download it from there since this one is not online I think.

Print this item

  I don't succeed to download an image to 300 DPI
Posted by: Paul - 02-28-2024, 02:10 AM - Forum: General questions - Replies (7)

Hi,

I'm a beginner in the field. Please help me solve a problem. I have a 2500x3500px image, which I have uploaded in GIMP, to make part of it transparent. Then I wanted it to be downloaded with 300 DPI. Although I set the "Scale Image" to 300 DPI, when I downloaded it, I only had a 120 DPI image.
I made several attempts but to no avail,  GIMP refuse to download the image at 300 DPI.
Where am I going wrong?
Thank you.

Print this item

  snap to grid
Posted by: gimpygirl - 02-28-2024, 12:14 AM - Forum: General questions - Replies (1)

Hi

When you make a grid and then do a crop, the selection with the mouse snaps to the grid automatically when you reach a grid line.
Can this be turned off too?

Print this item

  Selection deletion making layer turn transparent
Posted by: FolkFriend - 02-27-2024, 04:06 PM - Forum: General questions - Replies (1)

Hello all and thank in advance for your help with this unusual issue! I have been using Gimp for a very long time with no issues but recently whenever I create a selection using the fuzzy select tool and use the delete key to rub it out, I find that the remaining parts of the layer go semi-transparent. Can anybody tell me how to prevent this please?

Thanks!

Print this item

  ofn-export-layers
Posted by: gimpygirl - 02-27-2024, 01:15 AM - Forum: General questions - Replies (9)

I use ofn-export-layers a lot. Super useful plugin!
I noticed a very strange thing in windows 10 , GIMP 2.10.36

When ofn-export-layers is running (writing files) and I enter text anywhere on my computer, it adds characters I don't enter on my
keyboard like: ~ and ' and many more. So if I write "test", it adds random character in "test" which I dont really enter...

When ofn-export-layers has finished, this strange thing dissapears and I can enter text normally

Also ofn-export-layers runs very slow. Is this related to this?

I wanted to ask if the developer can tell me what this problem could be and if ofn-export-layers can be made faster (if possible).

So I need to wait to enter text anywhere until ofn-export-layers finished his work.

Print this item

  automate layer movement
Posted by: gimpygirl - 02-27-2024, 01:02 AM - Forum: General questions - Replies (19)

Hi

Referring to this post:

https://www.gimp-forum.net/Thread-Cut-sq...from-iamge

I use the method with the guides and 2 python scripts.

2 questions:

1. Is it possible to automate layer movement? The images all have the same size. The layer needs to be moved in order to fit the guides of size 150 px. Is there a plugin or script that can let me move a layer to a position by entering x,y values or something?



2. Is is possible for the ofn-export-layers to have {numUp0}.png appear automatically so that I don't need to enter it each time when i run gimp?



Attached Files Image(s)
   
Print this item