Setting Interlace to None in .NET
Posted: 2018-03-05T13:55:32-07:00
Bear with me as I'm new to using ImageMagick and couldn't find the answer to this online. I'm dealing with existing code that takes 2 png files and merges them together to form a final png file. Basically an image is going to be printed onto a t-shirt, we receive the image and then merge the file with a template of the t-shirt (or tank top or dress). Everything works fine with the below code. The resulting PNG that gets created though is interlaced (I assume this is due to the merging of the 2 files). The problem I'm having now is we are changing the program that is being used to print these t-shirts. The new program cannot input an interlaced PNG. Is there a setting that I can put into the below code to make sure the final .PNG is not interlaced? I saw where you can include "-interlace none" from the command prompt, but I'm not sure how to incorporate that into my existing code.
Here is what is being used currently:
static void Main(string[] args)
{
using (MagickImage mask = new MagickImage(@"c:\test\maskO2_XS.png"))//black where the cut would be white where the asset is
using (MagickImage image = new MagickImage(@"c:\test\STYLE1_XS_asset_before.png"))//pattern file
{
mask.Resize(image.Width, image.Height);
mask.Density = new Density(150, DensityUnit.PixelsPerInch);
image.Composite(mask, CompositeOperator.Bumpmap);
image.Write(@"c:\test\file_out.png");
}
}
I tested converting the file after the output to a noninterlaced copy of the file and it works, but the amount of time that putting an extra convert into the code would cause issues. I would like to do it all at the same time if possible.
Here is what is being used currently:
static void Main(string[] args)
{
using (MagickImage mask = new MagickImage(@"c:\test\maskO2_XS.png"))//black where the cut would be white where the asset is
using (MagickImage image = new MagickImage(@"c:\test\STYLE1_XS_asset_before.png"))//pattern file
{
mask.Resize(image.Width, image.Height);
mask.Density = new Density(150, DensityUnit.PixelsPerInch);
image.Composite(mask, CompositeOperator.Bumpmap);
image.Write(@"c:\test\file_out.png");
}
}
I tested converting the file after the output to a noninterlaced copy of the file and it works, but the amount of time that putting an extra convert into the code would cause issues. I would like to do it all at the same time if possible.