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

Adaptive threshold negative offset

Jun 6, 2015 at 7:03 AM
Graphics Magick's convert command can perform local adaptive thresholding via the -lat option with a negative offset percentage. I tried this using GraphicsMagick.NET and the resultant image was empty. Using a positive or zero offset worked. Any suggestions?

Here's my code:
        using (var bitmap = new Bitmap(inputFile))
        using (MagickImage image = new MagickImage(bitmap))
        using (var outputStream = File.OpenWrite(outputFile))
        {
            image.Negate();
            image.AdaptiveThreshold(15, 15, new Percentage(-15));
            image.Write(outputStream, MagickFormat.Png);
        }
Coordinator
Jun 7, 2015 at 10:39 AM
This seems to be a 'bug' in Magick++ of GraphicsMagick, it only allows positive offsets. I have contacted to maintainer of GraphicsMagick and asked him to change this in the next release of GraphicsMagick.
Jun 7, 2015 at 4:50 PM
Awesome, thank you!
Coordinator
Jun 7, 2015 at 8:42 PM
Jun 8, 2015 at 6:30 PM
Holy smokes, you guys are quick! Do you have an estimate as to when this could be included in the .NET wrapper, or should I just build the latest C++ library and make the modification in the .NET wrapper?
Coordinator
Jun 9, 2015 at 7:18 AM
I will try to publish a new release this weekend that includes this fix.
Jun 9, 2015 at 1:52 PM
OK, thanks again.