I want to merge 2 layers using script-fu code

95 views Asked by At

I am new to script-fu in gimp. I want to merge 2 layers using script-fu code. But I don't know how to write down the function. Can you help me write the (.scm) function for me

1

There are 1 answers

0
Yogeshwari Bahiram On

(define (layers-to-psd image-path psd-path) (let* ( (image (car (gimp-file-load RUN-NONINTERACTIVE image-path image-path))) (number-of-layers layer (car (gimp-file-load-layer RUN-NONINTERACTIVE image image-path)))

)
(define merged(car gimp-image-merge-layer-group image layer image-path)
(file-psd-save RUN-NONINTERACTIVE image merged psd-path psd-path 1 0)
(gimp-image-delete image)

) ) )

save above code in layers-to-psd.scm and Run using following command: gimp -i -c -b '(layers-to-psd "image/path" "output/psd/path")' -b '(gimp-quit 0)'