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
1
vote
1 answer

Why is the 'clear' not working?

I have a python-fu script, which is mostly working. It scans a layer looking for a color, rectangular selects contiguous areas of that color, copies the portion of image in another layer covered by that selection, and saves it to a separate file. …
EdwinW
  • 1,007
  • 2
  • 13
  • 32
1
vote
2 answers

Change the background from transparent to some color using gimp

I've large set of images. I wan't to chage their background to specific color. Lets say green. All of the images have transparent background. Is there a way to perform this action using python-fu scripting in Gimp. Or some other tool available to do…
Red Devil
  • 349
  • 4
  • 16
1
vote
1 answer

How to call pdb.gimp_pencil in Gimp Python-fu plugin

I'm trying to automate the task of drawing lines with Gimp. So I tried the scripting feature with no luck so far. >>>from pprint import pprint >>>img = gimp.Image(200, 200, RGB) >>>pprint (pdb.gimp_pencil.params) ((16, 'drawable',…
Farsee
  • 457
  • 3
  • 7
1
vote
1 answer

python-fu Copy an Image

I've a color list file I read it into a python list and I'd like to create one (or several) image(s) composed by squares with background color read from file and as foreground html string of the color (written with white). I.e. I read #ff0000 from…
Alberto
  • 718
  • 4
  • 20
1
vote
1 answer

is there a way in gimp to find points on the layer?

Suppose I have an image with several dots (as int the attached file). Is there a way for a script to find these dots and give me an array of them? I guess I can do this via image processing, but I was hoping that there was a script that will do…
Yotam
  • 10,295
  • 30
  • 88
  • 128
1
vote
1 answer

Select by color doesn't select all the pixels of the desired color in a python-fu script

I am writing a python-fu script for gimp that should have a line where it select all pixels of certain color. To do this, I added the line: …
Yotam
  • 10,295
  • 30
  • 88
  • 128
1
vote
3 answers

How can you specify a default value, using a function, in a gimp python plugin?

I am trying to get gimp to use a reasonable default path in a "save as" plugin, and to do that I need to be able to specify the default with the return value of a function (I believe). Currently, my code is something like: def do_the_foo(image,…
user153275
1
vote
2 answers

GIMP, python-fu: How to disable "Input image" and "Input drawable"

i am confused a little about the art of how gimp generates the gui for python plug-ins. gimp generates two, for my script, needless fields. "Input image" and "Input drawable". how can i disable them? I didn't find anything about it in the standart…
Hehe Muha
  • 19
  • 6
1
vote
1 answer

Gimp: why can't I register this?

I'm writing an add-on for Blender to sync it with Gimp and this script should be able to start from within Gimp, but I can't register it... Why? blender_gimp_sync.py: # -*- coding: utf-8 -*- #!/usr/bin/env python from gimpfu import * def…
Antoni4040
  • 2,297
  • 11
  • 44
  • 56
1
vote
1 answer

Python-fu GIMP script do not paste image

I'm trying to write a script that slice a layer into small peaces. It run correctly but nothing is pasted into a new layer. def explode_layer( i, l, dx, dy ): T=[] for ix,ox in enumerate(range(l.offsets[0], l.offsets[0]+l.width, dx )): …
Arpegius
  • 5,817
  • 38
  • 53
0
votes
1 answer

Python-fu: How to batch process color-to-alpha and opacity threshold

I'm trying to batch process images in GIMP 2.10 using a Python-Fu script. The script should apply the following transformations to each image in a folder: color to alpha with RGB value (246, 246, 246) transparency threshold of 0.035 opacity…
0
votes
0 answers

Gimp gimp_image_convert_color_profile_from_file does not work

I'm trying to automate some task with gimp but it seems so that the color profile converting does not work. pdb.gimp_image_convert_color_profile_from_file(image, r"d:\Todelete\Input\eciRGB v2.icc", 1, TRUE) I tried with different icc files,from…
randomname
  • 41
  • 4
0
votes
1 answer

Is there a way to make text italic with Python-Fu for GIMP?

My script changes text in a text layer, but doing that changes the text from italic to normal text. Is there a way to not make it change; or to change it back afterwards? I looked in the command browser in gimp but only found commands to change the…
chappe67
  • 101
0
votes
1 answer

how to select and manipulate a portion of text inside a text layer using python-fu

I wrote a gimp python plugin to create an image, add a text layer, and write some text into it. Similar to this one. I want to apply a different formatting to a portion of this text but I can't find the function to do it when I browse Filters >…
delki8
  • 379
  • 4
  • 17
0
votes
2 answers

GIMP python-fu, How to get the directory of the last saved image

I'm trying to create some GIMP plug-in and here I have gtk FileDialog: chooser = gtk.FileChooserDialog(title="Save as...", action=gtk.FILE_CHOOSER_ACTION_SAVE, buttons=(gtk.STOCK_SAVE, …
noirhor
  • 3
  • 2