Page 1 of 1

find almost completely white pictures

Posted: 2018-01-13T02:15:16-07:00
by forte.giulio
Hi
I am writing small VB.NET application that delete almost white jpeg images in a folder.
The images are generated by a scanner.

For IM I found that the command line commando could be like this:
convert image1.jpg -format "%[fx:mean>0.99?1:0]"
As this is my first project with Magick.NET, I would be very grateful to anyone who can give me a hint on how to do that with Magick.NET in vb.net or C #

Thanks

Re: find almost completely white pictures

Posted: 2018-01-14T03:49:41-07:00
by dlemstra
You can use the `FormatExpression` method for this in Magick.NET:

Code: Select all

using (var image = new MagickImage("image1.jpg"))
{
    var mean = image.FormatExpression("%[fx:mean>0.99?1:0]");
    if (mean == "1")
    {
        // Do something...
    }
}

Re: find almost completely white pictures

Posted: 2018-01-15T10:21:42-07:00
by forte.giulio
Thanks it works perfekt :D