Questions tagged [python-fu]

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

103 questions
14
votes
1 answer

Writing a GIMP python script

What I want to do is to open gimp from a python program (with subprocess.Popen, perhaps), and in the same time, gimp will start with a python script that will open an image and add a layer... Well, how can I achieve that(I wish GIMP had better…
Antoni4040
  • 2,297
  • 11
  • 44
  • 56
13
votes
3 answers

How do I save (export) all layers with gimp's script fu?

With gimp fu, I can save the content of one layer (at least, that is how I interprete the definition of gimp_file_save because it takes the parameter drawable). Now, I have the following script: from gimpfu import * def write_text(): width =…
René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293
11
votes
1 answer

Gimp: python script not showing in menu

I followed this tutorial and this is what I have come up so far: #!/usr/bin/python # -*- coding: utf-8 -*- #http://www.ibm.com/developerworks/library/os-autogimp/ from gimpfu import* def plugin_main(timg, tdrawable, maxh=540, maxw=800): …
kyng
  • 457
  • 1
  • 6
  • 13
8
votes
1 answer

Gimp: How can I get the coordinates of path tool points?

I am new to gimp python-fu programming I have spent my 4 days WITH NO LUCK to figure out which is the best appropriate functions to use in order to get the coordinates of drawn path and show the output on gtk message box like the following…
Mahdi Alkhatib
  • 1,954
  • 1
  • 29
  • 43
6
votes
3 answers

GIMP on Windows - executing a python-fu script from the command line

In a Windows environment, I would like to make a call to GIMP for executing a python-fu script (through a BAT file) but the command line call I am using does not produce the expected results. For example, consider the following python-fu script…
Tfb9
  • 219
  • 3
  • 8
6
votes
1 answer

Python-fu/gimpfu parameters - What does "image" mean?

I've been trying to switch from script-fu to python-fu, and I can't figure out what I'm supposed to pass for the "image" parameter. In script-fu it was just an integer, but when I put the same integer into python-fu, it just says it's the wrong…
Zaay'd
  • 65
  • 1
  • 5
6
votes
2 answers

Get sublayers from group layer with Python in Gimp

I have an XCD file with a nested layers structure: image front-layer content-layer content-layer-name-1 content-layer-name-2 content-layer-name-3 back-layer I open the file with image =…
tbicr
  • 24,790
  • 12
  • 81
  • 106
5
votes
1 answer

GIMP Python-fu exporting file only exports transparent layer

I am having issues saving images in python via GIMP. I can get the image and apply the effects I want, but when I go to save, it only saves one layer and not everything (NOTE: The background is transparent) and because the background is transparent,…
Josh Menzel
  • 2,300
  • 4
  • 22
  • 31
5
votes
1 answer

GIMP Python-fu nested group layers

I can't seem to find any methods for adding a Group Layer to another Group Layer anywhere in the python-fu interface. I've tried to find methods on the Gimp.Layer objects as well but with no luck. How do I add a group layer to another group layer…
Larpon
  • 812
  • 6
  • 19
4
votes
2 answers

How do I change text in a python-fu gimp script without changing the font?

I have a master image which I edit in gimp to get the look and feel wanted. I then want to use a python script to produce a bunch of new images with the text (on several different layers) changed. I would like to leave the font, size, italicized or…
argentum2f
  • 4,842
  • 2
  • 25
  • 30
4
votes
1 answer

Batch export all open windows in Gimp

I just manually edited 200+ .PDF files in gimp and I would like to batch export all of them at once (in .PDF) instead of exporting one by one. I have the plugin-registry installed, but I'm not sure if I can take advantage of it in this case. I think…
SpidrJeru
  • 119
  • 3
  • 13
3
votes
1 answer

How to execute a "Channel to Selection" in Gimp python-fu?

I want to convert custom channels into selection using python-fu. This can be done manually in Gimp using "Channel to Selection". I can retrieve the image and the channel as Python objects but I can’t figure out how to convert this channel to…
Narann
  • 819
  • 2
  • 8
  • 20
3
votes
1 answer

GIMP python-fu call function plug_in_beautify 'wrong number of parameters'

I try to use the great Beautify plugin in python command line and I am unable to call the function the right way! Here is my code: import os from gimpfu import * inputPath = os.path.join('xxxx', 'fire.png') if(file.lower().endswith(('.png'))): …
jcs
  • 426
  • 3
  • 14
3
votes
1 answer

Close current file/view/display without saving it or beeing asked to do so

I have opened an xcf file "BY HAND" in Gimp. How can i close this file (that is also the current view/display) without beeing asked if i want to save it. I need the register function to give me the "current Display" something like PF_Display ...…
Andre Elrico
  • 10,956
  • 6
  • 50
  • 69
3
votes
1 answer

Gimp python-fu how do I select a polygon?

Problem I have the need to make a polygonal selection on an image hundreds of times. To help, I have been trying to use the python console to create a script that will do this in a calculated fashion (same size area, hundreds of different start…
James Jensen
  • 731
  • 1
  • 7
  • 14
1
2 3 4 5 6 7