0

another subject could be: How do i crop a t-shirt out of a pattern image(image is big enough we have huge printers)

Everyone,

Could you please guide me on what the commands would be to do a cut of an image. Im new to ImageMagic and did not see anything that was exactly (only partially) to handle my issue. We get already presized image files to go on a mens or womens tshirt (soon dress). To save spraying all the ink we would like to cut the image to predefined coordinates for each size, and type.

How do I first determine (given a template files) all the coordinates and create commands for each size and style.

Will this work in .NET? I can still work with php, and c++ if you prefer.

Here is a link to an example of what needs to be done. http://www.relationship1.com/help.zip

Inside help.zip is

STYLE1__XS_TEMPLATE_FILE_PDF.pdf – outline of what needs to be CROPPED out for this size and style STYLE1_XS_asset_before.png – this is the image before STYLE1_XS_TEMPLATE_FILE_PHOTOSHOP_METHOD.ODS – this is some photoshop file they use to do this manually with (there is some hidden layer in here) STYLE1_XS_TFILE_PDF_WITH_IMAGE_AND_TEMPLATE.pdf – this is what the step would look like right before its completed STYLE1_XS_TT_asset_completed.png – this is the desired input

  • 1
    I don't think anyone wants to download zip files and wade through PDFs and Photoshop details and understand your product ranges/sizes and catalogue. You need to make a **minimal**, **simple**, **repeatable** example of a programming question to fit well on StackOverflow. – Mark Setchell May 26 '16 at 21:07
  • really the only contents that are necessary to understand are the two png files – Michael Rudner Evanchik Jun 01 '16 at 15:03

1 Answers1

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

    }