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

New Post: How to overlay a tiled pattern on a solid background?

$
0
0
It turns out there is already a method called Texture for what you are trying to do. You can accomplish the output image with the following code:
using (MagickImage pattern = new MagickImage("connect.png"))
{
  pattern.Alpha(AlphaOption.Set);
  pattern.QuantumOperator(Channels.Alpha, EvaluateOperator.Set, Quantum.Max / 2);

  using (MagickImage wallpaper = new MagickImage(new MagickColor("#2980b9"), 1440, 900))
  {
    wallpaper.Texture(pattern);
    wallpaper.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>