Search code examples
c#imagemagickpngpsdmagick.net

MagickImage - Converting PSD to PNG - Cannot render the Layer Style in Generated PNG


I hope you all are Fine, Today I'm experiencing a quite confusing problem. I'm trying to make a simple application which can convert the PSD to Transparent PNG. But I'm not happy with the results I'm getting.

I'm using Magick.NET-Q16-x86.DLL (MagickImage) with C#

Below is my code snippet, Please review:

ImageMagick.MagickImage image = new MagickImage(filePath+"[0]");
image.Density = new Density("300");
image.Format = MagickFormat.Png32;
image.Write(outputFolder + @"\" + Path.GetFileNameWithoutExtension(filePath) + ".png");

And Here is the Image explaining the Problem: (Left Side is Expected Result and Right Side Image is the one I'm getting )

enter image description here

So I don't understand whats Happening here. I'd really be thankful if i can get any answer. Thanks a lot for reviewing!

Best, Maher


Solution

  • The issue with this image is that it does not contain a 'merged image'. This is the image that combines all the layers from your PSD file. And the reader now creates this merged image itself.

    The problem with this is that ImageMagick/Magick.NET does not support all features of Photoshop and that is why it creates this image. It might be possible that the image can be read in the future but it will take a lot of time to implement all the PSD features.