Questions tagged [script-fu]

Script-Fu is a version of Scheme embedded in The GIMP, used to automate image manipulation tasks.

Script-Fu is the embedded scripting language of the GIMP image editor. It is based off a dialect of Scheme called TinyScheme, which is nearly R5RS compatible; because of this, general language issues with Script-Fu could benefit from the larger audience of the tag. GIMP's documentation site has a section on scripting which deals with the Scheme language used by Script-Fu.

Script-Fu is intended for automating image manipulation; because of this, it also includes a large library of functions. Questions about the Script-Fu library should always be tagged .

In addition to the Script-Fu plugins provided by The GIMP itself, two repositories of scripts exists at The GIMP Plugin Registry, as well as at GIMP Scripts. In addition, the complete Script-Fu library is accessible through GIMP's Procedure Browser, which includes not only core functions built into GIMP but also functions belonging to any installed plugins.

152 questions
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

Attach text on path in GIMP

I'm discovering the gimp API for few days now (using python-fu) and I actually enjoy it. However there is something I can't manage to do : attach a text on a path. Using the user interface to perform it is quite easy (create a path > create a text >…
lvictorino
  • 575
  • 4
  • 18
3
votes
1 answer

How to make a rectangular selection on an image in gimp using script-fu/scheme

I try my hands on scripting with scheme in gimp, and started with something that should be easy: write a script that creates a selection on the upper half of the image. Something like (set! sel (gimp-create-selection img)) and then work on that…
Gyro Gearloose
  • 1,056
  • 1
  • 9
  • 26
3
votes
1 answer

Concatenate string and variable in script-fu (TinyScheme)

I am trying to write a simple script-fu function. I want it to take a filename as argument and load this file from a folder (whose path will be hardcoded). Base code: (define (myfunction inputfile) (let * ( (image (cat (file-png-load 1 inputfile…
Yann Pellegrini
  • 793
  • 3
  • 7
  • 19
3
votes
2 answers

gimp script-fu: drawing a simple line

I'm trying to draw a line using gimp scripting. In the following script: I create a new image 512x512 and a I try to draw a diagonal (0,0)->(512,512). But the image (tmp.xcf) remains transparent. What am i doing wrong ? (define (drawdiagonal W…
Pierre
  • 34,472
  • 31
  • 113
  • 192
3
votes
2 answers

How to use Script-fu to select stroke line as in the "Stroke Path" - "Stroke Line" dialog

In Gimp 2.6 there is an "Edit" -> "Stroke Path" dialog. Within this dialog there is a "Stroke Line" area with options for line-width, Cap style, Join Style, Mitre limit, etc. How would I stroke a path with the "stroke line" options from script-fu.…
Yasir
  • 27
  • 1
3
votes
2 answers

Repeated rotation - increasing image dimension at export to png

I want an user to draw something. I will rotate that image many times and I will save each file to a folder. A template is img.png, for example img24.png is the original image rotated by 24 degree. It's like using Rotate tool, set it to 24…
Darek Nędza
  • 1,420
  • 1
  • 12
  • 19
3
votes
2 answers

Gimp : To move a layer's position within an image

I have a simple problem that's stumping me in GIMP Script-fu and procedural browser. I'm trying to move a layer up/down in an image which has 40 layers. Let us call the image test.xcf and the said layer Chromask-snapshot. NOTE : The layer X Y…
3
votes
0 answers

Halfmanualy crop image

I have a few hundred photos. Each photograph is one object. And with each photo repeat the same steps: Open, select the area; crop, resize, fix brightness, save. My attempt to automate the process: write a script and hang it on a hotkey. (define…
Max Bogach
  • 31
  • 1
3
votes
1 answer

number->string and related procedures in GIMP scheme scripting

I am frustrated with string-to-number and number-to-string conversion in GIMP scripting. I am runnning GIMP 2.6.8 in Windows Vista. I understand that GIMP's internal Scheme implementation changes over the versions and I can't seem to nail down…
dim fish
  • 469
  • 1
  • 4
  • 12
3
votes
1 answer

Why does this script-fu not work?

(define (script-fu-create-camo image colA colB)) (script-fu-register "script-fu-create-camo" "Camoflauge" "Creates a camoflauge pattern on an image" "Jeffrey Aylesworth
Jeffrey Aylesworth
  • 8,242
  • 9
  • 40
  • 57
3
votes
2 answers

GIMP: Create image stack from all image files in folder

I need to compare the results of segmentation algorithms where lots of images need to be stacked - e.g. original and binary image. So I thought of a GIMP script which takes the name of a directory and puts all containing image files into layers so…
Cassimir Ovin
  • 111
  • 1
  • 7
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
1 answer

Why can't GIMP handle this script?

I have this script as an .scm in Gimp: ;MIT license. (define (script-fu-export-layers img drw path outnameformat) ; credit to Vijay Mathew on Stack Overflow for the expand keywords function (let ((expand-keywords (lambda(format tokens) (let…
Stuart P. Bentley
  • 10,195
  • 10
  • 55
  • 84
2
votes
2 answers

GIMP duplicate layer at script-fu console

How do I duplicate a layer at the script-fu (scheme) console? Here is what I have done so far: (gimp-image-list) This tells me that the reference to my image is the number "1". Next, I get a reference to the particular layer I want to…
Michael
  • 9,060
  • 14
  • 61
  • 123
1
2
3
10 11