Page 1 of 1

A Wand way of converting PSD to one PNG

Posted: 2016-01-23T13:45:31-07:00
by binbin
Hi,
I am trying to convert a PSD file to a PNG file with Wand API.

I understand that by default imagemagick will convert each layer in a PSD file into separated PNG file.

With imagemagick 'convert' command line I can use '-flatten' parameter to merge all layers into a single PNG file, so I want to know how to do the same thing with the 'wand' method.

Any advice will be appreciated. My libmagickwand library is from the version 6.6.9.7.

Re: A Wand way of converting PSD to one PNG

Posted: 2016-01-23T14:00:41-07:00
by fmw42
The first layer of a PSD file is the flattened layer. So just convert the first layer to PNG.

In commmand line, one would do

Code: Select all

convert image.psd[0] image.png
Sorry, I do not know how to do that in any APIs.

Re: A Wand way of converting PSD to one PNG

Posted: 2016-01-23T22:26:45-07:00
by binbin
Thanks for the reply. I did try to get the first layer with the prefix [0] but that's not the flattened one.
But the command "convert -flatten image.psd image.png" creates the flattened one that I was expecting.

This is the sample I used for testing:
http://www.freepik.com/free-psd/spring- ... 766469.htm