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
2
votes
1 answer
What does wrapping a string in N_() do in Python-Fu?

Inversus
- 3,125
- 4
- 32
- 37
2
votes
1 answer
Gimp save all layers to files with the layers size
I've a .xcf-file with 20+ layers that I use for making a sprite-file.
I'd like to save all these layers to separate files with only the content and size of each layer.
I found this script for gimp: https://github.com/jiilee/gimp
Unfortunately that…

mabs
- 987
- 1
- 10
- 17
2
votes
4 answers
python can't import gimpfu
I'm trying to write a gimp script using pythonfu. However, when I try to run script locally, I get an error
`--> ./vvv.py
Traceback (most recent call last):
File "./vvv.py", line 5, in
from gimpfu import *
ImportError: No module…

Yotam
- 10,295
- 30
- 88
- 128
2
votes
1 answer
How to define a directory input parameter for Gimp Python-Fu plugin
I am building a plugin for Gimp using the Python-Fu interface, and I want the user to specify an output directory where my plugin would then generate several subdirectories and save output files in them. To define a file selection parameter for my…

AnjoMan
- 4,838
- 4
- 20
- 28
2
votes
1 answer
Python: executing a complex command on windows
I am having a problem when running a command on Windows whereas it works perfectly on Linux.
I give you the context, but this is not necessary to understand my issue: I am using gimp in batch mode.
I have a Python script callPythonFuScript.py which…

user1530966
- 51
- 4
1
vote
1 answer
How do you paint a stroke in Gimp with Python-fu?
I'm using Python-fu's gimp.pdb.gimp_paintbrush_default(layer, 2, [10,10, 20,20]), but no matter how many strokes I tell it to paint, it only ever paints the first (x,y) (in this case, (10,10)). Is it expecting a different format? The documentation…

derefed
- 679
- 5
- 17
1
vote
1 answer
How to prevent Color Banding with GIMP?
Just doing a simple bump_map operation in python GIMP. But the result has color banding!
import os, glob, sys, time
from gimpfu import *
image = pdb.gimp_file_load(img_path, img_path, run_mode=RUN_NONINTERACTIVE)
gray =…

user2827214
- 1,191
- 1
- 13
- 32
1
vote
1 answer
Gimp Python scripts work separately but not when combined
I have a multilayer Gimp XCF template and my goal is to automate inserting JPGs into it and export them from the command line.
I have a first working python-fu plugin for inserting the image, and a second working python-fu plugin for…

Tim B.
- 47
- 3
1
vote
1 answer
Save PNG with transparent border
Just starting out with python-fu in Gimp. I'm trying to emulate in python what I can do in the UI:
Create a new image, say 1000px wide, 500px high, transparent fill.
Open as layers "file1.png", which is 800px wide, 500px high - this leaves 100px of…

pinksy
- 301
- 4
- 14
1
vote
2 answers
Cannot locate gimp.xxx() or pdb.gimp_xxx() function for >applying< a gradient fill
Can not find python function (either gimp.xxxx() or pdb.gimp_xxxxx() ) that will actually APPLY the gradient selected as current with either
gimp.gradients_set_active() (which seems to have disappeared) or
…

Chrys G
- 99
- 10
1
vote
0 answers
How could I convert this henna tattoo to black and white?
I'm trying to extract the henna tattoo pattern from the image and have tried applying a median filter (despeckle) and detecting the tattoo with Difference of Gaussians, but the detail I get is always way below what seems possible by looking at the…

Johannes Riecken
- 2,301
- 16
- 17
1
vote
1 answer
is there a way to copy a filter from one layer to another layer using python
i'm using python-fu, i want to copy the filter iwarp i added to one layer to another layer i just added to the document.
my code:
document = gimp.image_list()[0]
layer_with_filter = document.layers[0]
layer_without_filter = document.layers[3]
i…

Abdul Hamid
- 168
- 1
- 7
- 25
1
vote
1 answer
Gimp, python-fu: Align layer with respect to background layer in image
The following code is used to align layer with respect to bottom background layer.
import os
from gimpfu import *
import gimpfu
import logging
def scale(logo, tdrawable, imageName):
logger = logging.getLogger()
logger.info('got…

rok
- 9,403
- 17
- 70
- 126
1
vote
0 answers
How to conform text to a surface using a displacement map in Python?
I am working on a project where I need to programmatically add a text to an image such that the text conforms to the surface so that it looks much more real-life.
Here is an example of what I am talking…

Moon
- 33,439
- 20
- 81
- 132
1
vote
1 answer
Python-fu script not showing in Gimp menu
I’ve been at Gimp: python script not showing in menu and it didn’t help me. Here’s what I tried, step by step:
1. I’m running Gimp 2.8.16 on Mac OS X 10.9.5 from the command line with gimp as my .bashrc file includes
alias…

Júlio Reis
- 173
- 11