Convert IM command to Magick.NET

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
johnbasi
Posts: 14
Joined: 2017-12-08T02:45:45-07:00
Authentication code: 1152

Convert IM command to Magick.NET

Post by johnbasi » 2017-12-20T23:46:45-07:00

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");
}

User avatar
dlemstra
Posts: 1444
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Convert IM command to Magick.NET

Post by dlemstra » 2017-12-24T06:00:32-07:00

Can you also share your input image so I can see what you are trying to do?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

Post Reply