Friday, March 02, 2007

gimp script-fu #2

so now i wanted to add shadows from a script.
like this: gimp -i -b - < shadow3.scm
the final shadow3.scm looks like this: ( WARNING ... this changes "n.png")
(define (simple-shadow filename)
(let*
(
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image)))
)

(set! outshadow (car (script-fu-drop-shadow image drawable 1 1 1 '(0 0 0) 35 FALSE)))

(gimp-image-merge-down image drawable 1)
(set! drawable (car (gimp-image-get-active-layer image)))

(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
)


(simple-shadow "n.png")
(print errobj)
(gimp-quit 0)


;eof
hope that pasting here doesnt mix up any important whitespace.
note the (print errobj) ... that's really useful for debugging
now i only got to write a bash script that iterates over all images, copies them to n.png and back

0 Comments:

Post a Comment

<< Home