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

New Post: Masking image with shape

$
0
0
The output isn't also exact but the following works for me with the latest version:
using (MagickImage image = new MagickImage("2rnubmq.jpg"))
{
  using (MagickImage mask = new MagickImage(MagickColors.Black, image.Width, image.Height))
  {
    mask.Settings.FillColor = MagickColors.White;
    mask.Draw(new DrawableCircle(image.Width / 2, image.Height / 2, image.Width, image.Height / 2));

    image.Composite(mask, CompositeOperator.CopyAlpha);
    image.Write("test.png");
  }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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