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

New Post: Masking image with shape

$
0
0
The packages I reference below are from Nuget.

In version 7.0.0.21 - which must still be using im6 I was able to mask an image with a circle shape like this:
using (var overlay = new MagickImage(localimagePath))
using (var mask = new MagickImage(MagickColor.Transparent, 694, 694)){
            var circle = new DrawableCircle(346,346, 692, 346);
               
             mask.FillColor = Color.White;
             mask.Draw(circle);
             mask.Alpha(AlphaOption.Off);

             overlay.Mask = mask;
             overlay.Composite(mask, CompositeOperator.CopyAlpha);
}
The latest nuget moves to im7 which has a bunch of changes including removal of FillColor for BackgroundColor and changes to Alpha. I have tried the ReadMask function and others, but I cannot get it to render anymore. Most of the documentation for im still seems to be v7, with the update, do you know if I need to switch to readMask or where to look for the correct documentation?

Thanks

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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