Page 1 of 3

adaptive-sharpen not working?

Posted: 2013-04-16T11:51:55-07:00
by Der_Hexer
I'm not sure if I'm using it wrong or if there is a bug involved:
Due to recommendations for using adaptive-sharpen (http://imagemagick.org/discourse-server ... =1&t=10266) I decided to give it a try.
I'm using "Version: ImageMagick 6.8.3-10 2013-03-22 Q16" on Mac OSX 10.8.3 with this command-line:

Code: Select all

convert source.jpg -resize 150x150 -adaptive-sharpen 0x0.6 -quality 80 target.jpg
The used source is a 1300x1300px photo and is converted to a 150px thumbnail..
What's interesting: this resulting target.jpg is identical to the version used with this command-line (without -adaptive-sharpen):

Code: Select all

convert source.jpg -resize 150x150 -quality 80 target.jpg
Both are absolutely identical regarding their bits and bytes.

Am I doing something wrong or is there really a bug in this function?

Re: adaptive-sharpen not working?

Posted: 2013-04-16T12:50:37-07:00
by fmw42
0x0.6 is almost no adjustment. However, going back to my post in the link you referenced, when I tried 0x5 and 15x5 (since that old post indicated that the radius needed to be specified), I found that neither produce any change in the image.

Image

I am not sure if this is a reasonable test image or not for -adaptive-sharpen. I also tried using the lena image as well with the same zero difference from compare with the original.

convert test.png -adaptive-sharpen 0x3 1tmp1.png
convert test.png -adaptive-sharpen 9x3 1tmp2.png
compare -metric rmse test.png 1tmp1.png null:
0 (0)
compare -metric rmse test.png 1tmp2.png null:
0 (0)



convert test.png -adaptive-sharpen 0x10 1tmp1.png
convert test.png -adaptive-sharpen 30x10 1tmp2.png
compare -metric rmse test.png 1tmp1.png null:
0 (0)
compare -metric rmse test.png 1tmp2.png null:
0 (0)

Re: adaptive-sharpen not working?

Posted: 2013-04-16T14:07:08-07:00
by Der_Hexer
So basically you are also confirming that nothing seems to result in any difference?
I tried a couple of different values (10x1.9, 1x1.9, 10x5.9, etc.) and all result in two identical jpgs.

Or do you have any two settings that result in two different files?

Re: adaptive-sharpen not working?

Posted: 2013-04-16T14:22:39-07:00
by fmw42
No, it does not seem to be working as far as I can tell. In my earlier post on the link you provided, I had found that if one specifies a radius (typically 3 times the sigma value) that it did make a difference. Now even that does not work for me. But again, this is an adaptive script and it may be image dependent. However, I would have expected to see some difference and not a perfect compare value of zero.

Re: adaptive-sharpen not working?

Posted: 2013-04-16T16:32:46-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-0 Beta available by sometime tomorrow. Thanks.

Re: adaptive-sharpen not working?

Posted: 2013-07-03T18:00:42-07:00
by areohbee
I've never been able to get adaptive sharpening to work (I've tried several times over the years, most recent being as installed by ImageMagick-6.8.6-3-Q16-x64-dll.exe). Is it broken? discontinued??, or is there some secret I'm missing??? It's not just that I can't see sharpening differences, but the files are identical, sharpened vs. not-sharpened. Everything else mogrify-wise works.

Re: adaptive-sharpen not working?

Posted: 2013-07-03T18:25:20-07:00
by fmw42
It works very well on the lena image in IM 6.8.6.3 Q16 Mac OSX


Input:
Image

convert lena.png -adaptive-sharpen 0x3 lena_as0x3.png
Image

Re: adaptive-sharpen not working?

Posted: 2013-07-03T19:17:27-07:00
by snibgo
Confirmed that it works in v6.8.6-0 on Windows 7:

Code: Select all

D:\web\im>%IM%convert lena.png -adaptive-sharpen 0x3 lenas.png

D:\web\im>%IM%compare -metric RMSE lena.png lenas.png NULL:
2998.01 (0.0457468)

Re: adaptive-sharpen not working?

Posted: 2013-08-11T07:15:09-07:00
by areohbee
I just downloaded lena.png and ran the identical command (convert lena.png -adaptive-sharpen 0x3 lenas.png) - not getting any sharpening via adaptive-sharpening.

win 7/64
IM 6.7.3-4

Note: although the image data appears same (picture comparator shows images as displayed are 100% identical), but lenas.png is 116 KB wheras lena.png is 178KB, so "sharpened" file is considerably smaller for some reason.

I'm not sure whether it's expected or what not, but seemed worth noting..

R

Re: adaptive-sharpen not working?

Posted: 2013-08-11T10:46:46-07:00
by snibgo
Have you tried it with a more recent version of IM?

Re: adaptive-sharpen not working?

Posted: 2013-08-11T10:51:08-07:00
by fmw42
It was not fixed until v6.8.5-0 as per Magicks comments above

Re: adaptive-sharpen not working?

Posted: 2013-08-11T10:55:29-07:00
by areohbee
Oh - thanks fmw42 and snibgo. I can't run 6.8.6 - something wrong with ICC profile. I guess I'll wait for next rev - thanks muchly.

Re: adaptive-sharpen not working?

Posted: 2013-08-11T11:23:13-07:00
by fmw42
If you are installing from unix source, you can get earlier versions (but after the fix) at http://www.imagemagick.org/download/legacy/

What platform are you using and how are you installing (source or binary)? Perhaps one of your delegates needs updating if installing from source.

If on Windows, I found this site of old binaries http://mhonarc.veidrodis.com/image_magick/binaries/

Re: adaptive-sharpen not working?

Posted: 2013-08-11T17:50:23-07:00
by areohbee
Thanks again fmw42.

I am installing Windows binaries.

Without knowing when the ICC problem was introduced, I'd not know which earlier rev to choose, without trying each one I mean.

But I need working ICC profiles, not adaptive sharpening, yet, so 6.7.3 is good for now.

ICC profiles are not working correctly in 6.8.6 - another person (who had installed an independent copy on an independent system) pointed it out to me, and I then verified it on my system. Dunno if its all cases or just some cases...

Rob

Re: adaptive-sharpen not working?

Posted: 2013-08-11T18:00:15-07:00
by fmw42
Please report the exact problem and command line, so that the IM developers can look into it and/or others can test it. If someone does not report it properly, then it will not get fixed.

Please start a new topic on the Bugs forum to report this properly.