1

We have a script which breaks a Photoshop PSD file into its three layers as PNG images, using the ImageMagick "convert" command:

convert my.psd -set dispose Background -coalesce -delete 0 temp.png

It's just like the answer to the SO question Extract layers from PSD with ImageMagick, preserving layout. We do want to see the output images aligned as in that question.

It works fine except sometimes when the middle layer is empty, that is, completely transparent. In this case it behaves as if that layer is missing, and produces PNG files for the other two layers only. How can I get all the layers?

I've been sifting through the ImageMagick documentation, trying variations on the options above, but no luck so far.

I'm on OS X 10.7.4.

$ convert -version
Version: ImageMagick 6.7.9-0 2012-08-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:  OpenCL   
Community
  • 1
  • 1
Hew Wolff
  • 1,489
  • 8
  • 17
  • hi, I have the same problem. so, have you found the answer? – Bobby Stenly Apr 08 '13 at 04:44
  • @Bobby, I ended up working around it. In my case there were only a few layers, and they all had known labels attached in the PSD. So I checked the layer labels using `convert $INPUT[$i] -format "%l" info:` to detect any missing output layer files, and then made new empty replacement layer files with `convert -size $SIZE xc:none $TEMP_FILENAME`. – Hew Wolff Apr 09 '13 at 23:54

0 Answers0