My main aim is to create a PSD file from list of images(Original image, background removed image and binary mask of original image). I am able to create a PSD file with 3 layes, one for original image, one for mask and one for background removed image. But I want to create a PSD with only 2 layers, One having background removed image and one with original image and mask linked to original image. I used following code to create PSD from list of input image. I also attached my expected PSD layers image and image of what I am getting.
Can anyone please help in making changes in below code so that I can get PSD as per above mentioned condition. If not then kindly guide in making changes in above mentioned script of linking mask with its image. Its urgent, I will be thankful to the gimp community.
My code
(define (layers-to-psd image-paths psd-path)
(define (add-layers image image-paths)
(when (not (null? image-paths))
(let*
(
(img-path (car image-paths))
(layer (car (gimp-file-load-layer RUN-NONINTERACTIVE image img-path)))
)
;; (display img-path) (newline)
(gimp-image-insert-layer image layer 0 -1)
(add-layers image (cdr image-paths))
)
)
)
(let*
(
(base-path (car image-paths))
(image (car (gimp-file-load RUN-NONINTERACTIVE base-path base-path)))
(drawable (car (gimp-image-get-active-layer image)))
)
;; (display base-path) (newline)
(add-layers image (cdr image-paths))
;; LZW compression (1), MSB to LSB fill order (0)
(file-psd-save RUN-NONINTERACTIVE image drawable psd-path psd-path 1 0)
(gimp-image-delete image)
)
)
Command
gimp -i -c -b '(layers-to-psd(list "original_image.png" "mask.png" "removed_background.png" ) "final.psd")' -b '(gimp quit 0)'
Output -
Image illustration of what i want to do
No, I am not the same poster but I want things to be exactly done as per the motive of this script. But there are some issues with this script. Can you please help. Its very urgent here.
Can anyone please help in making changes in below code so that I can get PSD as per above mentioned condition. If not then kindly guide in making changes in above mentioned script of linking mask with its image. Its urgent, I will be thankful to the gimp community.
My code
(define (layers-to-psd image-paths psd-path)
(define (add-layers image image-paths)
(when (not (null? image-paths))
(let*
(
(img-path (car image-paths))
(layer (car (gimp-file-load-layer RUN-NONINTERACTIVE image img-path)))
)
;; (display img-path) (newline)
(gimp-image-insert-layer image layer 0 -1)
(add-layers image (cdr image-paths))
)
)
)
(let*
(
(base-path (car image-paths))
(image (car (gimp-file-load RUN-NONINTERACTIVE base-path base-path)))
(drawable (car (gimp-image-get-active-layer image)))
)
;; (display base-path) (newline)
(add-layers image (cdr image-paths))
;; LZW compression (1), MSB to LSB fill order (0)
(file-psd-save RUN-NONINTERACTIVE image drawable psd-path psd-path 1 0)
(gimp-image-delete image)
)
)
Command
gimp -i -c -b '(layers-to-psd(list "original_image.png" "mask.png" "removed_background.png" ) "final.psd")' -b '(gimp quit 0)'
Output -
Image illustration of what i want to do
(05-26-2022, 11:37 AM)rich2005 Wrote: This is a straight copy / paste of this question from 8 months ago. https://stackoverflow.com/questions/6923...ith-a-mask
Are you the same poster ? Give a good reason for asking again, preferably in your own words.
----
Edit: Is the problem you are using Windows and the command is set up for linux Some adjustment to quotes maybe needed for Windows see: https://www.gimp-forum.net/Thread-Script...3#pid18873
No, I am not the same poster but I want things to be exactly done as per the motive of this script. But there are some issues with this script. Can you please help. Its very urgent here.