[Gimp-user] Q: Batch script adding alpha mask problem
Hi, I'm new at GIMP scripting. My task is to do a batch processing over an folder with images. Iwant to add an alpha layer to every image (png). The alpha layer is from a static second image (bmp). I can accomplish the task in the GIMP frontend manually, but the exactly same steps in my script aren't working. What am I doing wrong? Here's the script: (define (script-fu-batch-alpha-add globalpha globpics) (let* ((filelist (cadr (file-glob globpics 1))) (filealpha (car(cadr (file-glob globalpha 1 (imgalpha (car (gimp-file-load RUN-NONINTERACTIVE filealpha filealpha))) (drawablealpha (car (gimp-image-get-active-layer imgalpha))) ) (gimp-selection-all imgalpha) ;copy my static alpha image (gimp-edit-copy drawablealpha) ; to buffer and reuse it with every image (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))) (mask (car (gimp-layer-create-mask drawable 2))) ) ; add an alpha channel layer mask (gimp-image-undo-disable image) (gimp-layer-add-mask drawable mask) (gimp-layer-set-edit-mask drawable 1) (gimp-layer-set-show-mask drawable 0) (gimp-layer-set-apply-mask drawable 1) (gimp-edit-paste drawable 1); paste static alpha image to layer mask (WHICH IS NOT WORKING in BATCH ) (file-png-save-defaults RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist ) ; register (script-fu-register script-fu-batch-alpha-add Thanks for your help... -- spiderman (via www.gimpusers.com/forums) ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
[Gimp-user] Q: Batch script adding alpha mask problem
Hi, I'm new at GIMP scripting. My task is to do a batch processing over an folder with images. Iwant to add an alpha layer to every image (png). The alpha layer is from a static second image (bmp). I can accomplish the task in the GIMP frontend manually, but the exactly same steps in my script aren't working. What am I doing wrong? Here's the script: (define (script-fu-batch-alpha-add globalpha globpics) (let* ((filelist (cadr (file-glob globpics 1))) (filealpha (car(cadr (file-glob globalpha 1 (imgalpha (car (gimp-file-load RUN-NONINTERACTIVE filealpha filealpha))) (drawablealpha (car (gimp-image-get-active-layer imgalpha))) ) (gimp-selection-all imgalpha) ;copy my static alpha image (gimp-edit-copy drawablealpha) ; to buffer and reuse it with every image (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))) (mask (car (gimp-layer-create-mask drawable 2))) ) ; add an alpha channel layer mask (gimp-image-undo-disable image) (gimp-layer-add-mask drawable mask) (gimp-layer-set-edit-mask drawable 1) (gimp-layer-set-show-mask drawable 0) (gimp-layer-set-apply-mask drawable 1) (gimp-edit-paste drawable 1) ; paste static alpha image to layer mask (WHICH IS NOT WORKING in BATCH ) (file-png-save-defaults RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist ) ; register (script-fu-register script-fu-batch-alpha-add Thanks for your help... -- spiderman (via www.gimpusers.com/forums) ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
[Gimp-user] Q: Batch script adding alpha mask problem
(define (script-fu-batch-alpha-add globalpha globpics) (let* ((filelist (cadr (file-glob globpics 1))) (filealpha (car(cadr (file-glob globalpha 1 (imgalpha (car (gimp-file-load RUN-NONINTERACTIVE filealpha filealpha))) (drawablealpha (car (gimp-image-get-active-layer imgalpha))) ) (gimp-selection-all imgalpha) ;copy my static alpha image (gimp-edit-copy drawablealpha) ; to buffer and reuse it with every image (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))) (mask (car (gimp-layer-create-mask drawable 2))) ) ; add an alpha channel layer mask (gimp-image-undo-disable image) (gimp-layer-add-mask drawable mask) (gimp-layer-set-edit-mask drawable 1) (gimp-layer-set-show-mask drawable 0) (gimp-layer-set-apply-mask drawable 1) (gimp-edit-paste drawable 1); paste static alpha image to layer mask (WHICH IS NOT WORKING in BATCH ) (file-png-save-defaults RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist ) ; register (script-fu-register script-fu-batch-alpha-add -- spiderman (via www.gimpusers.com/forums) ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
[Gimp-user] Q: Batch script adding alpha mask problem
[the same(?) script for the third time] Are there supposed to be any differences between those scripts? sorry, it was just to get a good formating for readability. I forgot to say, that the scipt runs without errors. Images are processed, but no alpha channel is applied. Regards... -- spiderman (via www.gimpusers.com/forums) ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
[Gimp-user] Q: Batch script adding alpha mask problem
Thank you Kevin, just downloaded Imagemagick for Windows and my task is done with a single command :-) Found it here: http://stackoverflow.com/questions/5647840/how-to-combine-rgb-image-and-8-bit-alpha-image-into-single-png-file-with-imagema My efforts with gimp referred to this post: http://graphicdesign.stackexchange.com/questions/8397/gimp-using-an-image-as-the-transparency-layer-of-another-image Greetings... -- spiderman (via www.gimpusers.com/forums) ___ gimp-user-list mailing list List address:gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list