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

New Post: Overlaying two images with opacity

$
0
0
I think you are looking for the QuantumOperator method. The following example should make your image 50% transparent.
using (MagickImage image = new MagickImage("input.png"))
{
  image.Alpha(AlphaOption.Set); // If your image does not contain an alpha channel.
  image.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / 2);
  image.Write("output.png");
}
After that you should be able to combine both your images using the correct CompositeOperator. You probably have to experiment a bit to find the right one.

Viewing all articles
Browse latest Browse all 3693

Trending Articles