I have a below CLI and trying to achieve same result using magickwand c. Everything seems to be perfect or don't know may be I missed something but the MagickUnsharpMaskImage is not working for me. Check my source code. I also attached source and two output images generated by CLI and C API.
CLI
convert testsharp.jpg -unsharp 0x1 unsharpC.jpg
C code
int main(int argc, char const *argv[]) {
MagickWand * wand;
wand = NewMagickWand();
MagickReadImage(wand, "testsharp.jpg");
MagickUnsharpMaskImage(wand, 0.0, 1.0, 0.0, 0.0);
MagickWriteImage(wand, "unsharpW.jpg");
return 0;
}
source image
output image using CLI
output image using C
ImageMagick version
Version: ImageMagick 7.0.5-5 Q16 x86_64 2017-05-23 http://www.imagemagick.org
From the man
MagickUnsharpMaskImage()
sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 andUnsharpMaskImage()
selects a suitable radius for you.
Emphasis mine
You call it passing radius=0
sigma=1.0
Moreover default value for those parameters are
Correct c code to
MagickUnsharpMaskImage(wand, 0.0, 1.0, 1.0, 0.05);