adaptive-sharpen not working?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Der_Hexer
Posts: 2
Joined: 2013-04-16T10:53:20-07:00
Authentication code: 6789

adaptive-sharpen not working?

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adaptive-sharpen not working?

Post 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)
Der_Hexer
Posts: 2
Joined: 2013-04-16T10:53:20-07:00
Authentication code: 6789

Re: adaptive-sharpen not working?

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adaptive-sharpen not working?

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: adaptive-sharpen not working?

Post 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.
areohbee
Posts: 23
Joined: 2010-09-29T21:05:23-07:00
Authentication code: 8675308

Re: adaptive-sharpen not working?

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adaptive-sharpen not working?

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: adaptive-sharpen not working?

Post 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)
snibgo's IM pages: im.snibgo.com
areohbee
Posts: 23
Joined: 2010-09-29T21:05:23-07:00
Authentication code: 8675308

Re: adaptive-sharpen not working?

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: adaptive-sharpen not working?

Post by snibgo »

Have you tried it with a more recent version of IM?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adaptive-sharpen not working?

Post by fmw42 »

It was not fixed until v6.8.5-0 as per Magicks comments above
areohbee
Posts: 23
Joined: 2010-09-29T21:05:23-07:00
Authentication code: 8675308

Re: adaptive-sharpen not working?

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adaptive-sharpen not working?

Post 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/
areohbee
Posts: 23
Joined: 2010-09-29T21:05:23-07:00
Authentication code: 8675308

Re: adaptive-sharpen not working?

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: adaptive-sharpen not working?

Post 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.
Post Reply