Page 1 of 1

Convert from Mac to Magick.NET

Posted: 2016-06-01T08:17:42-07:00
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.

Re: Convert from Mac to Magick.NET

Posted: 2016-06-01T09:20:42-07:00
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.

Re: Convert from Mac to Magick.NET

Posted: 2016-06-01T14:18:53-07:00
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");
            }
        
        }

Re: Convert from Mac to Magick.NET

Posted: 2016-06-01T14:19:42-07:00
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");
            }
        
        }