Hi,

I have used ImageMagick for batch mode treatment of images but
would (have to) use gimp for certain functions.

Being completely new to the gimp script-fu, I copied an example
from the intertubes

-----
(define (batch-unsharp-mask pattern
                            radius
                            amount
                            threshold)
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let* ((filename (car filelist))
                  (image (car (gimp-file-load RUN-NONINTERACTIVE
                                              filename filename)))
                  (drawable (car (gimp-image-get-active-layer image))))
             (plug-in-unsharp-mask RUN-NONINTERACTIVE
                                   image drawable radius amount threshold)
             (gimp-file-save RUN-NONINTERACTIVE
                             image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))
-----

saved it as

~/.gimp-2.6/scripts/batch-unsharp-mask.scm

and run it with

gimp -i -b '(batch-unsharp-mask "*.jpg" 5.0 0.5 0)' -b '(gimp-quit 0)'

It worked.

I also found the function 'gimp-levels-stretch' in the Script-Fu
Procedure Browser and tried to adapt the example script:

-----
(define (stretch-levels pattern)
  (let* ((filelist (cadr (file-glob pattern 1))))
    (while (not (null? filelist))
           (let* ((filename (car filelist))
                  (image (car (gimp-file-load RUN-NONINTERACTIVE
                                              filename filename)))
                  (drawable (car (gimp-image-get-active-layer image))))
             (gimp-levels-stretch RUN-NONINTERACTIVE
                                  image drawable)
             (gimp-file-save RUN-NONINTERACTIVE
                             image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))
-----

saved as 'stretch-levels.scm in ~/.gimp-2.6/scripts/ and run as

gimp -i -b '(stretch-levels "*.jpg")' -b '(gimp-quit 0)'

Does not work and prints the error message:

'batch command experienced an execution error'


I would be very much obliged for any help getting the 'gimp-levels-stretch' 
function run in batch mode.
Any pointers to online instructions etc. would be appreciated.

Thanks, W.

-----
Gimp 2.6.2 on opensuse11.1
_______________________________________________________________________
Aufgepasst: Sind Ihre Daten beim Online-Banking auch optimal gesch├╝tzt?
Jetzt absichern: https://homebanking.web.de/?mc=m...@footer.hb

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply via email to