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

Unshaprmask working?

Jul 21, 2014 at 10:40 PM
Hello,

Is Unsharpmask actually working?

I am trying to do with Magick.net the following:

convert in.png -unsharp 0x5 out.png

and i tried many possible values in MagickImage.Unsharpmask , but I actually don't see any different in the output image..

Can you please help me translate the convert syntax into Magick.net ?

Thanks in advance for your attention!
Jul 22, 2014 at 12:18 PM
The default parameters for amount and threshold are 1.0 and 0.05. I will add an overload that only needs two parameters the next release. You can compare the images with the Compare method to get the difference:
using (MagickImage image = new MagickImage("logo:"))
{
  image.Unsharpmask(0, 5, 1.0, 0.05);
  // Next release
  // image.Unsharpmask(0, 5); 

  // Save to file so you can see the result
  image.Write(@"C:\logo.png");

  using (MagickImage other = new MagickImage("logo:"))
  {
    MagickErrorInfo info = image.Compare(other);
    Console.WriteLine(info.MeanErrorPerPixel);
  }
}
Why are you using the Unsharpmask method? What are you trying to accomplish?
Jul 22, 2014 at 8:33 PM
Thats just great, thanks for the explanation and code! It worked like a charm :)

Well, i simply need to be able to apply Unsharp filter on images..
Sep 4, 2014 at 11:50 AM
Edited Sep 4, 2014 at 11:51 AM
dlemstra wrote:
The default parameters for amount and threshold are 1.0 and 0.05. I will add an overload that only needs two parameters the next release. You can compare the images with the Compare method to get the difference:
using (MagickImage image = new MagickImage("logo:"))
{
  image.Unsharpmask(0, 5, 1.0, 0.05);
  // Next release
  // image.Unsharpmask(0, 5); 

  // Save to file so you can see the result
  image.Write(@"C:\logo.png");

  using (MagickImage other = new MagickImage("logo:"))
  {
    MagickErrorInfo info = image.Compare(other);
    Console.WriteLine(info.MeanErrorPerPixel);
  }
}
Why are you using the Unsharpmask method? What are you trying to accomplish?
Something got broken in Unshaprmask. Up to ver 6.8.9.601 it is working just fine, as of ver 7.0.0.0001 it does simply nothing.

I am applying image.Unsharpmask(0, 5, 1, 0.05) to an image and displaying it and as of ver 7.0.0.0001 there's no change at all. Ofcourse I tried and just image.Unsharpmask(0, 5); still no luck..
Sep 4, 2014 at 11:57 AM
Can you upgrade to 7.0.0.0002 and see if the problem still occurs?
Sep 4, 2014 at 11:59 AM
dlemstra wrote:
Can you upgrade to 7.0.0.0002 and see if the problem still occurs?
yes, it doesn't work on it as well, i tried it. Both versions after 6.8.9.601 have the issue
Sep 4, 2014 at 12:09 PM
Edited Sep 4, 2014 at 10:08 PM
I will take a look at it later this week/weekend.

Edit: The bug has been found and fixed in ImageMagick. This will be fixed in Magick.NET 7.0.0.0003.