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

New Post: Composite with displacement map

$
0
0
From the ImageMagick command line I can do composition using following commands.
composite displace_map.png image.png -displace 60x60 displace_out.png.
This is working. But how can I convert the following command to Magick.Net. I have tried this which did not work.
            string srcImage = @"image.png"; 
            string srcDisplaceMap = @"displace_map.png";

            using (var gradient = new MagickImage(srcDisplaceMap))
            {
                using (var flatImage = new MagickImage(srcImage))
                {
                    flatImage.VirtualPixelMethod = VirtualPixelMethod.Gray;
                    flatImage.Composite(gradient, Gravity.Center, CompositeOperator.Displace, "60x60");
                    flatImage.Write(@"out.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>