; Snippet to show of to iterate over all layers ; placed in the Public Domain 2002 by Simon Budig ; ; You are encouraged to place your script that you create with ; this snipped under the Gnu GPL. (define (script-fu-iterate-layers image drawable) (let* ((layers (gimp-image-get-layers image)) (num-layers (car layers)) (layer-array (cadr layers)) (layer 0) (i 0)) (if (> num-layers 0) (begin (set! i 1) (while (< i num-layers) (set! layer (aref layer-array i)) ; do something to the layer here (set! i (+ i 1))) ))))