Python-Fu is a set of Python modules that act as a wrapper to libgimp allowing the writing of plug-ins or standalone scripts for GIMP
Questions tagged [python-fu]
103 questions
0
votes
1 answer
How to programmatically set color in gimp (pythonfu)?
Using Python, I was able to add a floating text layer using
text_layer = pdb.gimp_text_fontname(image, drawable, x, y, text, border, antialias, size, size_type, fontname)
However, the text appears in black. Specifically…

sprog
- 40
- 7
0
votes
1 answer
gimp python-fu resize text box
I have a simple python-fu script for gimp
list_of_text = [
"long string one",
"long string two ",
]
x=200
y=400
border=0
font_size=62
font="Merriweather"
path='/Users/incognito/blank_card.xcf'
for text in list_of_text:
image =…

Incognito
- 20,537
- 15
- 80
- 120
0
votes
1 answer
GIMP pythonfu get drawable from current image
I am iterating over all open images. I want to apply threshold on each of them. Since the threshold plugin takes drawable as argument, the drawable should be changed every time the image is changed, at least that's what programatically makes sense.…

Masum
- 243
- 1
- 2
- 6
0
votes
2 answers
Adjust levels for RGB channels in Gimp python-fu?
According to the docs I can access image channels via channels property but this gives me an empty list. I suspect only user-created channels are accessible via this property. How do I get a channel object for the R, G and B channels?
def…

SpliFF
- 38,186
- 16
- 91
- 120
0
votes
1 answer
How to change GIMP print size with script-fu
I am using GIMP 2.10.24. I have some image and I need to change Print Size Width to 21mm and Height to 30mm.
I can do that with Set Image Print Resolution Dialog (Menu->Image->Print Size):
screenshot
But there is my question: how could I do that…

noirhor
- 3
- 2
0
votes
1 answer
How to save an image as a lossless webp using only GIMP's python-fu
I have a python-fu question.
I am using GIMP 2.10.12, mac version.
Let's say I have an image open in GIMP
Original example image:
and I want to save it in webp format using python-fu. I do this:
img=gimp.image_list()[0]
layer=img.layers[0]…

asequentialart
- 3
- 3
0
votes
1 answer
How do i rename a Layer using python-fu
I would like to rename the new layer which i just created.
floating_sel = pdb.gimp_selection_float(drawable, 0, 0)
pdb.gimp_floating_sel_to_layer(floating_sel)
pdb.gimp_item_set_name(item, "s")

Merlin Blatterer
- 13
- 4
0
votes
1 answer
Exported GIMP picture to png using python-fu not displayed correctly
When I try to save an image using python-fu in GIMP, the picture is not displayed correctly in another software (pivview) I have to use.
When I export the picture manually, with all boxes above colormode unchecked, 16bpc RGB, comression level 5,…
0
votes
2 answers
Gimp python script from current image
I'm trying to get to grips with image manipulation using GIMP and I'm failing at the first hurdle:
With an image loaded in GIMP, I want to run a registered script to run a function - simply rotate the whole image by 90 degrees and then display a…

Ghoul Fool
- 6,249
- 10
- 67
- 125
0
votes
0 answers
Run GIMP Python script from command line
I'm trying to run a GIMP script that I had working on a Mac earlier in the year. Only now I'm on a PC, and I can't seem to get it to run.
Originally, on the Mac I processed a folder of images with:
/Applications/Gimp-2.10.app/Contents/MacOS/gimp…

Ghoul Fool
- 6,249
- 10
- 67
- 125
0
votes
1 answer
How do I set properties for different icon layers using file_ico_save in Python-Fu?
I'm using the following code to successfully create an icon with Python-Fu in GIMP:
pdb.gimp_palette_set_background('green')
image = pdb.gimp_image_new(256, 256, RGB)
image.new_layer(pos=1, fill_mode = BACKGROUND_FILL)
fileName =…

stackprotector
- 10,498
- 4
- 35
- 64
0
votes
0 answers
Gimp automation(Scripz Fu/Python Fu)
I have a design and need to download them in batch but every download has another variable. For instance the design is:
I like [variable]
variable should be different at any download.
Example of variables: [Programming, Basketball, food]
So…
user10540788
0
votes
1 answer
Gimp python-fu how to change menu text (label)
I got this code:
from gimpfu import *
def goOn(url) :
# change text
return
register("won","auto go","include image","D.X","D.X","2020","Launch server...",
"",[(PF_STRING, "string", "URL", 'http://localhost:3000')],
…

Marson J.
- 15
- 6
0
votes
1 answer
GIMP bash, add layer to existing GUI instance
I'd like to communicate with the existing GUI instance of GIMP, with a plugin.
I already have an another app and I want it to add a layer in the current existing GUI instance of GIMP.
Is it possible?
The scenario is:
I open GIMP (GUI),
then after…

Marson J.
- 15
- 6
0
votes
0 answers
How to run a batch file to run a python-fu gimp script?
Further to the question here about how to run python scripts using gimpfu from windows command line, is there a way to neatly package up the script? That's to say, without having to type a long (and complicated command line) - it's not for me it; I…

Ghoul Fool
- 6,249
- 10
- 67
- 125