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

How to convert decimal to hexadecimal in Scheme? (Need to convert RGB to HEX in GIMP)

How to convert decimal to hexadecimal in Scheme? Need to convert RGB to HEX in GIMP for JSON after: (set! imgcolor (car (gimp-color-picker image newDraw 1 1 TRUE TRUE 1))) in Script-fu. Result now is in RGB like: (255 255 255)
1
vote
1 answer

Gimp batch usage on macOS doesn't read script fu file

I'm trying to make my first steps with Gimp batch processing, but I'm stuck at the very beginning. I'm getting this error: z80crews-iMac:~ z80crew$ /Applications/GIMP-2.10.app/Contents/MacOS/gimp -i -b '(do-it "france.png" "spain.png")' -b…
z80crew
  • 1,150
  • 1
  • 11
  • 20
1
vote
1 answer

Scriptfu not executing in the correct order, Why?

I'm trying to write a basic script for GIMP but it doesn't seem to want to work right. It should follow this order after I make my selection: Lower active layer, expand selection 2px, floodfill w/ foreground color, raise active layer. The final…
Matthew
  • 11
  • 1
1
vote
2 answers

Invalid ID for argument 'layer' in GIMP script-fu

I'm using the following script to batch-process some image files with GIMP script-fu: (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (imagelayer (car…
Jonas Sourlier
  • 13,684
  • 16
  • 77
  • 148
1
vote
2 answers

How to append to a file using Scheme?

I am using TinyScheme (actually Script-Fu in GIMP), and cannot find a good way to open a file and append a line of text to it. I am trying to log some info to the file for debugging, and transcript-on doesn't seem to be implemented... Right now I am…
j w
1
vote
1 answer

Handle exception in Scheme script-fu

I wrote a script for Gimp (script-fu !) in Scheme. The script calls for the really awesome tool "resynthesizer", at some point. (python-fu-heal-selection 1 image drawable 10 0 0) Now, the probleme is that the user has to have installed Resynthesizer…
Sergei Leduc
  • 35
  • 1
  • 6
1
vote
1 answer

Batch save all opened files in GIMP .xcf

I have a series of manually edited images and layers in GIMP, each set is in a single tab. All want to save all of them into different .xcf's. I am aware of some scripts to export them as images (like this one), but I want to save them as .xcf, not…
pbruno
  • 147
  • 10
1
vote
3 answers

Mix command and variables in shell scripting

I need a very simple shell script that processes all images on a folder and changes its size. The image processing is done with gimp script-fu and the only thing that the shell script have to do is the for loop. I made this: #!/bin/sh mkdir…
dgnin
  • 1,565
  • 2
  • 20
  • 33
1
vote
1 answer

How can I make this GIMP/ImageMagick script?

I'm using GIMP to do a simple but tedious operation for many images so I'd like to know how I can make a script that will do it for me, or find some simpler way of doing this. I import an image file that has large dimensions but is mostly square,…
user9728650
1
vote
2 answers

Providing a meaningful default directory name in GIMP Scheme (script-Fu)

I'm a total newbie to Scheme (about 1 week). I'm registering a script for which the second parameter is an output directory name - via SF-DIRNAME. How do I supply a meaningful default to the front-end widget that does not use host platform-specific…
VectorVictor
  • 693
  • 1
  • 10
  • 20
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
1 answer

Gimp Script-Fu cond none of the conditions execute

I am trying to set up a conditional statement in a Gimp Script-Fu script, and nothing appears to be executing. (gimp-message "before cond") (cond [#t (gimp-message "I should see this")] [else (gimp-message "I shouldn't see…
TJ Rockefeller
  • 3,178
  • 17
  • 43
1
vote
0 answers

GIMP Script-Fu: "Error: (: 1) car: argument 1 must be: pair"

I'm rather new at using GIMP's script-fu, and I'm working on a script to go through a full folder of .tif image files, resize them to having a dimension a maximum size of 1200 pixels while maintaining the proportions of the image. It then will save…
1
vote
1 answer

Remove transparent pixels from selection in GIMP (Script-Fu)

I'm writing a script for GIMP and I'm stuck on this. I want to deselect transparent pixels from user selection. GIMP doesn't take RGBA values, so I can't just write: (gimp-image-select-color inImage CHANNEL-OP-SUBTRACT inLayer '(0 0 0 0)) There is…
JasonSpine
  • 15
  • 1
  • 10
1
vote
1 answer

GiMP (Scheme) Script-fu error "illegal function"

I am busy with a Script-fu and keep getting "Error ( : 1) illegal function". I am not a Scheme/Lisp expert, just trying to automate some photographic tasks. Documentation is rare - either GiMP only writing about their own internal actions but not…
fotonix
  • 166
  • 1
  • 7