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
3
votes
1 answer
How to Execute Python-Fu script from shell via Gimp
I'm trying to figure out a simple way to execute a Python-Fu script I wrote up that's working in single-threaded mode from the Python-Fu interpreter plugin of Gimp but will no longer work when refactored into its multiprocessing equivalent due to…

jxramos
- 7,356
- 6
- 57
- 105
3
votes
2 answers
Scaling an image with python-fu in GIMP slower then via built-in GUI
I use Python-Fu inside GIMP 2.8.14 on OS X to automate my asset pipeline production for a game.
But I noticed that the method pdb.gimp_image_scale is slower when I execute it from my script, compared to the build-in feature "Image > Scale Image...…

JeanLuc
- 4,783
- 1
- 33
- 47
3
votes
1 answer
python-fu select copy paste
I'm a newbie in python-fu, (my second day), so my question may seem naive: I'd like to select a rectangular portion from "r400r.png", rotate it 90 degrees, and save my selection in "r400ra.png".
So far, I tried something on these lines:
for fv in…

SxN
- 31
- 1
- 3
3
votes
2 answers
Using ipython as the gimp py-fu interpreter, sending all output and input to the terminal
Ideally I'd like to be able to start gimp from a terminal, then have that terminal behave as an ipython interpreter for gimp. Someone in this thread on gimp forums…

pixelpax
- 1,435
- 13
- 22
2
votes
0 answers
GIMP scripting: can a batch process be interactive?
I have a folder of images from which I need to make 60x60pixel thumbnails. The originals are of mixed sizes, and I'd like to be able to select which portion of each image to use for the thumbnail. Is there a way to automate this with Gimp…

Richard Inglis
- 5,888
- 2
- 33
- 37
2
votes
0 answers
gimp-drawable-transform-perspective doesn't work when asked to enlarge a layer
I'm using Python to develop a GIMP plug-in. I make use of the gimp-drawable-transform-perspective function called this way:
pdb.gimp_drawable_transform_perspective(
layer,
rect.x, rect.y,
rect.x +…

AsTeR
- 7,247
- 14
- 60
- 99
2
votes
3 answers
Can't run Gimp batch commands from a Mac / OSX
I'm trying to have Gimp batch process some files in OSX. The best example I've found is in this post: How to run python scripts using gimpfu from command line?. However for launching Gimp in batch mode, this, and every other example starts looks…

Tim B.
- 47
- 3
2
votes
1 answer
parameter type documentation for pdb.file_png_save2
Error message from gimp - pdb.file_png_save2(...)
(wrong parameter type) - parameters seem to follow doc but still gives error...
In a plug-in/script module I am trying to save a .png file. I am using
pdb.file_png_save2() because I need to…

Chrys G
- 99
- 10
2
votes
1 answer
Gimp python-fu: How to crop layer to selection
What is the GIMP API call to crop a layer to a selection, equivalent to Layer -> Crop to Selection in the GUI?
I looked in the Procedure Browser but the calls I found (gimp-crop and gimp-image-crop) perform the crop on the image, not a layer.
(What…

Ken Shirriff
- 1,654
- 16
- 20
2
votes
1 answer
GIMP batch editing (Script-fu/Python-fu)
I have about 500 images, I would like edit all of them in batch, I need to resize them all at to 190x120 dimensions, position then slightly higher (say 10 pixels). And export. Also I would like them all to keep their initial names.
Basically I have…

John Smith
- 851
- 2
- 10
- 22
2
votes
1 answer
Gimp python-fu : How to create and save multilayer xcf from 1 jpg and 1 png?
I've a huge list of directories containing for each 2 images : 1 jpg file and 1 png file; I want to create from an external script all the .xcf associated with the jpg as first layer. After trying with python I've been drowning in scheme…

FabKzo
- 35
- 4
2
votes
1 answer
gimp python plug in: how to trigger another user input
Situation:
My gimp python plug-in shows the user a drop down box with two options [".jpg", ".png"].
Question:
How to show a second input window with conditional content based on first input?
.jpg --> "Quality" range slider [0 - 100]
.png -->…

Breaker222
- 1,334
- 1
- 14
- 23
2
votes
0 answers
Subprocess / Gimp Commandline Batch Max Argument Length Shorter than Expected
I have a simple Python GUI that gathers a list of image file locations, which is passes to subproccess.run, which targets the gimp-console exe in order to modify them. While working with a large number of files with reasonably long directories I…

Reid Ballard
- 1,480
- 14
- 19
2
votes
2 answers
Open files with python script in Gimp like File->Open
TL;DR: How to open an Image in Gimp with Python like you do with (File->Open) in order to get the Overwrite file.png option and avoid the Save the changes to image 'sample.png' before closing? Dialog.
I wrote a Python script for Gimp which does a…

Pascal Tänzer
- 47
- 8
2
votes
1 answer
How can I draw with my current brush size in gimp python-fu?
I'm writing a GIMP python-fu script that essentially just draws a black circle on the current layer, filling up the layer. The problem I'm having is that gimp_pencil() continues to use the default brush size even after gimp_context_set_brush_size()…

Brendan
- 73
- 5