PSD conversions not maintaining transparency

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

PSD conversions not maintaining transparency

Post by Carter J »

Hi,

We are trying to change resolution of PSD files, But the output PSD files background is turning into black.

Command used:
convert -alpha off -units pixelsperinch -resample 72 InputPSDFile.psd outputPSDFile.psd

input PSD FIle:
https://www.dropbox.com/s/6xp7ydegrv3wq ... SDFile.psd

Imagemagick version:
Version: ImageMagick 6.8.8-9 Q16

Ghost Script Version:
9.10

OS:
Windows 7

And,

Is there anyway to know how many layers present in a PSD file
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PSD conversions not maintaining transparency

Post by dlemstra »

A psd file is not read by Ghostscript, we use our internal reader. It is not a vector image. Why do you need to add -alpha off when you want to keep transparency? I get the correct image with the following command:

Code: Select all

convert InputPSDFile.psd -units pixelsperinch -resample 72 outputPSDFile.psd
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Carter J
Posts: 116
Joined: 2013-12-19T02:20:09-07:00
Authentication code: 6789

Re: PSD conversions not maintaining transparency

Post by Carter J »

dlemstra wrote:A psd file is not read by Ghostscript, we use our internal reader. It is not a vector image. Why do you need to add -alpha off when you want to keep transparency? I get the correct image with the following command:

Code: Select all

convert InputPSDFile.psd -units pixelsperinch -resample 72 outputPSDFile.psd

Thanks, It worked.


Is there a way to know how many layers present in a PSD file ?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: PSD conversions not maintaining transparency

Post by dlemstra »

You can get the number of layers like this:

Code: Select all

D:\Test\psd>identify -format "%n" InputPSDFile.psd
1
D:\Test\psd>identify -verbose -format "%n" InputPSDFile.psd
2
The first example will show you the incorrect number of layers but I just added this to my todo list to fix this. The second value is the number of 'images', this works because of the -verbose option that was added. The is the number of layers + the merged image. So this image contains only 1 layer.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply