Convert from Mac 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
mcbain942
Posts: 13
Joined: 2016-05-26T09:08:40-07:00
Authentication code: 1151

Convert from Mac to Magick.NET

Post by mcbain942 »

Here is the original thread viewtopic.php?f=2&t=29775

I need to automate this on a large amount of large files (around 200mb a day)

Basically i have a large background and i want to slice out the neck ( collar ) , sides(if any extra), bottom of any extra, armpit below and above. based of some sort of template via an image(unfortunately the zip contains a pdf, please ignore that).

Each "cut" will be different for XS, X, M, L, XL, 2XL, as well as womens, and we are looking into doing dress "cuts"

Im going to try to convert the code, but ImageMagick is just not my cup of tea, and is truly magic.
mcbain942
Posts: 13
Joined: 2016-05-26T09:08:40-07:00
Authentication code: 1151

Re: Convert from Mac to Magick.NET

Post by mcbain942 »

this is basically what i want to do , but with a tshirt

viewtopic.php?t=21391

Ignore that the template file is a pdf, i have asked the client to send read png files with the correct size.
mcbain942
Posts: 13
Joined: 2016-05-26T09:08:40-07:00
Authentication code: 1151

Re: Convert from Mac to Magick.NET

Post by mcbain942 »

the following is the answer

Code: Select all

the following is the answer

 static void Main(string[] args)
        {
            using (MagickImage mask = new MagickImage(@"c:\help\maskO2_XS.png"))//black where the cut would be white where the asset is
            using (MagickImage image = new MagickImage(@"c:\help\STYLE1_XS_asset_before.png"))//pattern file
            {
                mask.Resize(image.Width, image.Height);
                image.Composite(mask, CompositeOperator.Bumpmap);
                image.Write(@"c:\help\file_out.png");
            }
        
        }
mcbain942
Posts: 13
Joined: 2016-05-26T09:08:40-07:00
Authentication code: 1151

Re: Convert from Mac to Magick.NET

Post by mcbain942 »

here was the answer

Code: Select all

the following is the answer

 static void Main(string[] args)
        {
            using (MagickImage mask = new MagickImage(@"c:\help\maskO2_XS.png"))//black where the cut would be white where the asset is
            using (MagickImage image = new MagickImage(@"c:\help\STYLE1_XS_asset_before.png"))//pattern file
            {
                mask.Resize(image.Width, image.Height);
                image.Composite(mask, CompositeOperator.Bumpmap);
                image.Write(@"c:\help\file_out.png");
            }
        
        }
Post Reply