Search code examples
imagemagickimagemagick-convert

Missing layer when Combining images into PSD using ImageMagick


I'm trying to combine 3 images using imageMagicks 7 latest version however the first layer is always missing.

convert "image_03.png" "image_02.png" "image_01.png" -background none -alpha set "product.psd"

However i only get two layers??

enter image description here

Attached are the images below ...

enter image description here enter image description here enter image description here


Solution

  • A PSD file expects a layer that is the flattened layer from all the other layers. It needs to be the first layer. Photoshop assumes the first layer is the flattened layer. It must be created in Imagemagick and combined with the other individual layers as the first image in the command sequence when writing a PSD file. So I create it last from clones and then insert it at the first position (0).

    Try the following.

    Unix syntax:

    convert "image_03.png" "image_02.png" "image_01.png" \( -clone 0-2 -flatten \) -insert 0 -background none -alpha set "product.psd"
    

    If on Windows, remove the \s from in front of the parentheses.

    Reorder the images as desired for the layers in the PSD file.