Page 1 of 1

Convert IM command to Magick.NET

Posted: 2017-12-20T23:46:45-07:00
by johnbasi
Hi, I have an IM command and I need it to be translated to Magick.net and replace the background to transparent.

Here is the command:
convert.exe test.psd[0] -alpha transparent -clip -alpha opaque -background white -flatten -resize 1000x1000 result.psd

I've tried this code below but it doesn't seem to work.

Code: Select all

using (var imagePath = new MagickImage(fileNamePath))
{
                imagePath.Alpha(AlphaOption.Transparent);
                imagePath.Clip("Path 1", true);
                imagePath.Alpha(AlphaOption.Opaque);

                imagePath.Write("testPath.psd");
}

Re: Convert IM command to Magick.NET

Posted: 2017-12-24T06:00:32-07:00
by dlemstra
Can you also share your input image so I can see what you are trying to do?