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
42
votes
5 answers

How to convert XCF to PNG using GIMP from the command-line?

As part of my build process I need to convert a number of XCF (GIMP's native format) images into PNG format. I'm sure this should be possible using GIMP's batch mode, but I have forgotten all of the script-fu I used to know. My input images have…
Laurence Gonsalves
  • 137,896
  • 35
  • 246
  • 299
23
votes
6 answers

Converting XCF and other files using command line with GIMP?

If I have an XCF file (or any other supported by Gimp) how can I convert it to, for example, PNG for display or further processing?
Ivan Vučica
  • 9,529
  • 9
  • 60
  • 111
11
votes
6 answers

How to parse out base file name using Script-Fu

Using Gimp 2.6.6 for MAC OS X (under X11) as downloaded from gimp.org. I'm trying to automate a boring manual process with Script-Fu. I needed to parse the image file name to save off various layers as new files using a suffix on the original file…
Donald Byrd
  • 7,668
  • 4
  • 33
  • 50
10
votes
5 answers

Script fu 'unbound variable' error on arguments

So i tried to run the batch code from this tutorial: http://www.gimp.org/tutorials/Basic_Batch/ I copied and saved this to the .gimp-2.8 scripts folder (define (batch-unsharp-mask pattern radius …
Joe Staines
  • 301
  • 1
  • 3
  • 11
7
votes
1 answer

How to get a list of files (*. jpg) from all folders?

How do I get a list of files (*.jpg) from all folders, using Script-FU in GIMP? (let* ((filelist (cadr (file-glob pattern 1))) This only gets files from the current folder.
Smirnov
  • 153
  • 1
  • 1
  • 9
6
votes
1 answer

batch resize images with gimp

I want to resize every jpg in a directory. This is the gimp script I've found. Looks sensible to me. (define (batch-resize pattern) (let* ((filelist (cadr (file-glob pattern 1)))) (while (not (null? filelist)) (let*…
Richard Barraclough
  • 2,625
  • 3
  • 36
  • 54
5
votes
3 answers

How to debug script-fu scripts for gimp in scheme?

I try to make some script for gimp, using script-fu, scheme. Naturally, as a beginner, there are lots of errors and misunderstandings. Now I'm looking for a way to debug those scripts. I found (gimp-message), but the result does not show up. I'm not…
Gyro Gearloose
  • 1,056
  • 1
  • 9
  • 26
5
votes
1 answer

With Script-Fu, loading and saving a PNG loses alpha

I'm trying to write a script in GIMP that will load a PNG file and save it again with maximum compression (I also plan on adding other processing steps). The following script, however, seems to destroy alpha information: (define (process-png…
Olathe
  • 1,885
  • 1
  • 15
  • 23
5
votes
1 answer

String Replace in Gimp Script Fu

I have a Gimp plugin that renames files and I needed a replace function. Unfortunately TinyScheme that Gimp uses does not have a replace function for strings. I searched a lot but couldn't find one that worked as a true string-replace. Answer to…
Isaac
  • 121
  • 8
4
votes
1 answer

Script-Fu giving me "Illegal Function"

this is my first script-fu for gimp and it gives me "illegal function" when i try to execute it there. (define ( script-fu-c64ize filename width height ) (let* ( (image 0) ) …
DasAntonym
  • 452
  • 3
  • 19
4
votes
3 answers

GIMP get current image reference number to operate on current image

I have more than one image open, and I'd like to run scrip-fu functions on the currently selected image. How can I get the image reference number to the currently selected image so I can use the reference in other functions (e.g. (gimp-image-width…
EarthIsHome
  • 655
  • 6
  • 18
4
votes
2 answers

Batch convert from XCF version 11

I have a folder of images saved in .xcf format, and I would like to batch convert them to a more convenient format. I've tried a few approaches that haven't worked: I used to do this using IrfanView, but that no longer works because it refuses to…
nhowe
  • 909
  • 6
  • 14
4
votes
2 answers

How to export flattened image with GIMP Script-Fu

I've got a script that's supposed to flatten, resize and export an initial image. I'm stuck on the export. I'm using file-png-save. It seems fine with my parameters except for the third parameter, which is supposed to be a drawable. For the…
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

Gimp batch open as layer

I encountered a Problem using gimp batch mode. All I am trying to do is to open 2 png files as layers of one image and save them together as an Icon (.ico). Problem: Gimp just opens the two images as seperate windows, not as two images in one…
Felix
  • 6,885
  • 1
  • 29
  • 54
1
2 3
10 11