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

New Post: CompositeOperator enum

$
0
0
The CopyOpacity has been renamed to CopyAlpha in ImageMagick 7. But that is probably not what you want.

ImageMagick does some magic when the input image has no alpha channel and you compose with CopyOpacity/CopyAlpha. It uses the circle_mask as a mask for the image. The -alpha off forces this behavior (you can find a good explanation here: http://www.imagemagick.org/Usage/compose/#copyopacity. This means the command actually translates to this:
using (MagickImage img= new MagickImage("infilegif"))
{
  using (MagickImage mask = new MagickImage("circle_mask.png"))
  {
    using (MagickImage outfile = new MagickImage(MagickColor.Transparent, img.Width, img.Height))
    {
      img.Mask = mask;
      outfile.Composite(img, Gravity.Center, CompositeOperator.SrcOver);
      outfile.Write("outfile.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>