Script-Fu is based on SIOD, a small but efficient implementation of
Scheme. Unfortunately, SIOD varies in many ways from pure Scheme.
While a few of those variantions have little impact, some have great
impact. You can read more about SIOD at
One big difference is that SIOD does not provide vectors. Instead,
it provides things called arrays. Arrays are a lot like
vectors in that they are mutable and provide indexed access. Arrays
differ in that you typically specify the "kind" of thing that goes
in an array (e.g., real numbers (which programmers call
SIOD provides a few basic array procedures, including ...
My library provides a
float-array procedure that works
a lot like the standard
procedures that you know and love. That is, you give it as many
parameters as you like, and it builds an array of the appropriate size.
Once you've written a few useful Script-Fu procedures, you can actually add them to the Gimp menus (scary, isn't it). You need to follow two or three simple steps to get them added:
1. Write Scheme code that tells the Gimp to add a procedure to the menu. Here, you need to tell the Gimp what parameters your procedure takes so that it can ask the user for those parameters.
2. Put the Scheme code in a place the Gimp can find it. Typically, you'll
put your Scheme code in
(Yes, the period before the .gimp is important.) You'll only have to do
this once per script.
3. Tell the Gimp that you've added the script by selecting Refresh from the Script-Fu submenu of the Xtns menu. (You should only have to do this when you add or modify the script in the middle of a session. In the future, the Gimp should load your script automatically.)
Steps 2 and 3 are straightforward, so let's consider the first step
in more detail. You add a procedure with the
procedure. That procedure takes a large number of parameters.
<Image>for the image menu or
<Toolbox>for the toolbox menu
"RGB"but try other options later (they're documented somewhere)
For each parameter for your procedure, you'll need three parameters
I usually create these pages
on the fly, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Tue May 6 09:31:07 2003.
The source to the document was last modified on Sun Mar 30 22:17:08 2003.
This document may be found at