This project has moved and is read-only. For the latest updates, please go here.

Composite with displacement map

Mar 23, 2015 at 8: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");
                    flatImage.Write(@"out.png");
                }
            }
Mar 24, 2015 at 1: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 5: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?