You are here

Script-fu Master, give me a lesson!

Hey all! I'm trying to write my first script, but it is doing nothing.

nonroot@local:~/.gimp-2.7/scripts$ cat ./test.scm
(define (batch-blue)
(let* ((filelist (cadr (file-glob "*.jpg" 1))))
(while (not (null? filelist) )
(let* (
(filename(car filelist))
(image (car (gimp-file-load 0 filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(gimp-color-balance drawable 1 TRUE -0.3 -0.03 0.224)
(gimp-file-save 1 image drawable filename filename)
(gimp-image-delete image) )
(set! filelist (cdr filelist)))))

nonroot@local:~/testdir$ gimp -i -b '(batch-blue)' -b '(gimp-quit 0)'
This is a development version of GIMP. Debug messages may appear here.
mapped '/Xtns/Misc' to '/File/Create/Misc'
batch command executed successfully
plug-in 'script-fu' aborted before sending its procedure return values

The images from forder are updating, but color-balance is not changing....
Show me please my errors, i'm newb in scripting, have no idea.

Thanks!

I think you have a problem with the values you are using for the gimp-color-balance call. The procedure browser says the values can range from -100 to 100, but you are passing very small values, so it's not going to have much effect on the image. Try multiplying by 100: -30.0 -3.0 22.4

OMG! I'm like a babe lost in the woods. Where do I go to even understand these script entries. The phrases seem straightforward enough yet the relationship between these entries and what actions they perform is beyond me at this point. Is there a list of commands or phrases that can plugged in (pardon the pun) to create a script? Would it be a good idea to start by tweaking an existing script? Of course if my tweaks don't work the worst thing that would happen would be that it would either do nothing or crash.

Subscribe to Comments for "Script-fu Master, give me a lesson!"