Extract layers from PSD with ImageMagick, preserving layout

前端 未结 2 1376
清歌不尽
清歌不尽 2021-01-30 06:53

I\'m using ImageMagick to extract layers from a PSD, and it gets them all out fine with:

convert image.psd image-%d.png

But the resulting PNG i

2条回答
  •  臣服心动
    2021-01-30 07:41

    Type this to extract the layer number 2 from a PSD file:

    convert             \
      .psd[0] \
      .psd[2] \
      \(                    \
         -clone 0           \
         -alpha transparent \
      \)                    \
     -swap 0           \
     +delete           \
     -coalesce         \
     -compose src-over \
     -composite        \
     .png
    

    This creates first a transparent canvas with the same size of the PSD file, then combines it with the layer 2 keeping it's original layout (-coalesce)

提交回复
热议问题