This project has moved. For the latest updates, please go here.

Composite with displacement map

Mar 23, 2015 at 7:02 PM
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");
Mar 24, 2015 at 12:14 PM
I am getting different results in ImageMagick 6 and ImageMagick 7 (Magick.NET uses the latter). I will have to investigate this for you.
Apr 1, 2015 at 4:55 AM
The bug that I found was a command line issue only. I got the correct output image with Magick.NET. Can you explain in more detail (with some images maybe) the problem that you are experiencing?