RSS/Atom feed Twitter
Site is read-only, email is disabled

Need to write script but not sure where to start.

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Need to write script but not sure where to start. Walter Francis 24 Aug 17:47
  Need to write script but not sure where to start. Jeff Trefftzs 24 Aug 19:07
Walter Francis
2003-08-24 17:47:43 UTC (over 20 years ago)

Need to write script but not sure where to start.

I take a lot of IR photography and use Gimp to post-process the images.

The best way I've found to post process them is to do the following:

Decompose the image, recompose matching Red with Blue, Green Green, Blue with Red, then autolevels. This usually is a nice result, makes the skies more blue and other (light, false) colours look nicer.

There might be an easier way to switch the colors than decompose/compose, but I know that works.

I'd love to have a script-fu to do this, and it's proabaly rather simple to do, I just don't have a clue where to start. I've poked around in some of the script-fu that come with Gimp, looked at some on web pages, etc.. but trying stuff in the script-fu console I just get errors.

Anyone push me off in the right direction here?

Much appreciated.

Jeff Trefftzs
2003-08-24 19:07:49 UTC (over 20 years ago)

Need to write script but not sure where to start.

Hi Walter -

Script-fu is, as you know, a bastard dialect of Scheme, which is a Lisp variant. One of the problems in writing script-fu is finding a good reference manual for the Gimp's scheme implementation. Another is finding examples of good script-fu code.

You can find the scheme documents at http://www.cs.indiana.edu/scheme-repository/imp/siod.html (Note that the GIMP doesn't have all the functions listed in this manual, but it's close enough to work).

For examples of script-fu in use, look at the scripts that come with the GIMP: $PREFIX/gimp/1.2/scripts/ or
$PREFIX/gimp/1.3/scripts/
where $PREFIX is the path to your gimp installation (usually /usr or /usr/local).

There are several references to script-fu tutorials on the gimp.org website as well.
http://www.gimp.org/scripts.html

And there is also a script-fu group on yahoo: http://groups.yahoo.com/group/script-fu/ Post message: script-fu@yahoogroups.com Subscribe: script-fu-subscribe@yahoogroups.com Unsubscribe: script-fu-unsubscribe@yahoogroups.com List owner: script-fu-owner@yahoogroups.com

For writing scripts yourself, I would recommend starting with gimp-1.2.5 (the current stable version), and utililzing the PDB Explorer to help you figure out what arguments each function requires. I usually have it open in one window while I'm writing my script in an adjacent emacs window (YMMV). I find that the PDB Explorer is a real help, telling me what kinds of arguments, how many, and in what order.

You should also look at the scripts that came with our gimp distribution. That is particularly useful for learning certain idioms (like the quickest way to anchor a floating selection, etc.)

Feel free to mail me if you have more questions.