Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Composite ImageMagick equivalent in Magick.NET

$
0
0
I am sorry for the misunderstanding and I will try to publish a new release this weekend. I had almost the same code as you just posted, the correct code will be this:
// You don't need to clone the input image.//var dest = input.Clone(); using (var src = input.Clone())
{
  // There is an implicit cast from an integer to a Percentage.
  src.Colorize(new MagickColor(hexaColor), 100);

  using (var mask = input.Clone())
  {
    mask.ColorSpace = ColorSpace.GRAY;

    // Do not negate the image because the command line does that internally and the -negate is there to// 'double negate' (make it normal). The Magick.NET codes skips that part.// mask.Negate();// This will be the new property that works differently from ClipMask
    input.Mask = mask;

    input.Composite(src, Gravity.Center, CompositeOperator.Blend, "100,0");
    input.Write("imgOutput.jpg");
  }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>