On Wed, Apr 2, 2008 at 9:59 PM, rob <[EMAIL PROTECTED]> wrote:
> Whats the best way to learn script-fu?
>  Is there a good online tutorial? A book?
>  Seems to be a ton of instruction material on the web and I was wondering
>  if anyone can recomend something specific
>  that they thought was the best way to get started with batch image
>  processing with gimp.

Yes. Learn Python instead, as Python, since GIMP 2.4+, is the
preferred scripting language for gimp plugins, and it is far more
approachable than script-fu, unless you have LISP/Scheme experience.
. If you don't like that idea, or you cannot guarantee that your users
will all be using 2.4 with Python support, you could visit
since there is a script-fu there that does batch resizing -- you could
modify it to do batch [whatever you want] or just study it.

If you do like that idea,
is a great way to get started with Python, and


provides an example batch processing python script which I will quote
here, since it's not correctly indented there:

#! /usr/bin/env python

from gimpfu import *
import glob

def batch_unsharp_mask( file_pattern, radius, amount, threshold ):
    for file_name in file_list:
        image = pdb.gimp_file_load(file_name, file_name)
        drawable = pdb.gimp_image_get_active_layer(image)
        pdb.plug_in_unsharp_mask(image, drawable, radius, amount, threshold)
        pdb.gimp_file_save(image, drawable, file_name, file_name)

"batch_unsharp_mask", "", "", "", "", "",
"<Toolbox>/Xtns/Languages/Python-Fu/Test/_Batch Unsharp Mask", "",
(PF_STRING, "file_pattern", "file_pattern", "*.png"),
(PF_FLOAT, "radius", "Radius", 5.0 ),
(PF_FLOAT, "amount", "Amount", 0.5 ),
(PF_INT32, "threshold", "Threshold", 0 )


The 'gimptalk' link I gave also has a guide to getting GIMP-Python
working in windows. If you're using Linux, it's probably already
working and available :)

After learning python,
can provide you the details of how the GIMP API works in python.

Hope that helps!
Gimp-user mailing list

Reply via email to