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
I have a background/canvas with a solid color. I want to overlay a pattern on top of that background. I want to set the opacity of the tiled pattern too.

This is what I have
    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.Composite(pattern,0);
        wallpaper.Write("result.png");
    }
    pattern.Dispose();
I am getting a solid background and the pattern is on the upper left of the image. The opacity is not set. What else do I have to do?

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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