Page 2 of 2
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2010-01-12T21:18:48-07:00
by ccreekin
No Fred, I should try those scripts. Sharpedge has more of an effect on Lena's eyes (perhaps too much) and in some cases increases noise. Gaussianedge seems milder but still very noticeable. I am pleased with adaptive-sharpen, which is a big improvement over unsharp(mask). Adaptive seems to have wide latitude for different JPEG quality values.
The only downside is that -adaptive-shapen 0x0.1 produces ugly black splotches in my version of ImageMagick. But 0x0.6 made output files almost as small as did lesser values, so I settled on 0.6.
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2010-05-05T21:03:47-07:00
by anthony
ccreekin wrote:Also radius does have an effect, although not the effect that I expected. I should take a look at the source code.
The effect or radius is to specify the actual 'kernel' size used for the blur/convolve. using a very large radius just makes this slower, using a small radius has the effect of 'clipping the kernel' whcih makes things worse. a radius of 0 produces the smallest radius (with a lower limit of 5) that contains a numerically significant Gaussian value. A large radius than this has no effect... period... a smaller value clips the kernel to some degree.
The only time a radius value has a non-detrimental effect is when you are attempting to use linear blurring effects, rather than Gaussian blurring. For example using a operation such as "-blur 5x65535". This produces a flat square kernel for blurring, producing a linear or triangular gradient on sharp edges about 11 pixels wide (5x2+1 - the kernel width).
However this technique can be improved by using Disk kernels with -morphology Convolve.
See IM Examples, Mean or Average Filtering using Shape Kernels
http://www.imagemagick.org/Usage/morphology/#mean
The -moprhology, and its ability to use a 'shaped kernel' was only added to IM since this discussion had previously lapsed.
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2011-03-28T17:58:18-07:00
by hwttdz
I've just created a little perl script that does smart sharpening as described here:
http://gimpguru.org/Tutorials/SmartSharpening2/
You can find the script as well as a short description here:
http://astoryworthtelling.wordpress.com ... agemagick/
Please try different parameters and images, I tried it on a small selection of flickr explore images, and my personal images. And I think that it now gives either improvement or no change the majority of the time. But of course subject to personal tastes. It could possibly benefit from a curves adjust after the contrast stretch (done with linear stretch).
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2011-03-28T20:07:36-07:00
by fmw42
It could possibly benefit from a curves adjust after the contrast stretch (done with linear stretch).
try -gamma or -evaluate pow
or my curves script
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2011-03-29T10:26:10-07:00
by hwttdz
Fred,
I've posted some examples on the blog if you're interested (full size:
http://www.flickr.com/photos/hwttdz/set ... 34/detail/ ).
http://astoryworthtelling.wordpress.com ... agemagick/
Have you tried the script? I'd be interested to know what you think of the creation of the edge mask. But obviously getting best results would require the proper amount of sharpening in the sharpen layer, and a good edge mask.
-Joe
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2011-03-29T11:36:15-07:00
by fmw42
Joe,
No I have not yet tried your script. Though I have had in mind to create one like it for a while. I had also seen that post from the GimpGuru. My other scripts (binomial edge, gaussianedge, and sharpedge) did similar things, but may have had too much sharpening because I simply thresholded the edge image to binary. The concept of using -level to fix the upper and lower edges, plus a gaussian blur makes sense.
Fred
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2012-06-05T02:49:40-07:00
by 3aHyga
fmw42 wrote:Have you tried my gaussedge or sharpedge scripts? Curious how they compare to adaptive-sharpen!
Hello,
Where can I found your scripts to test and use them?
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2012-06-05T09:56:36-07:00
by fmw42
3aHyga wrote:fmw42 wrote:Have you tried my gaussedge or sharpedge scripts? Curious how they compare to adaptive-sharpen!
Hello,
Where can I found your scripts to test and use them?
See the link at the bottom of my post.
Re: How to "Smart Sharpen," adaptive-sharpen not working
Posted: 2012-06-05T11:23:11-07:00
by stupid
Isn't "smart sharpen" the same as edge sharpening? If so try this.
INPUT.JPG ^
( +clone -unsharp 0x2 ) ^
( -clone 0 -separate -evaluate-sequence Mean -blur 0x2 -negate -edge 2 -level 0,50%% -blur 0x2 -level 0,50%% ) ^
-composite ^
OUTPUT.JPG
The -separate -evaluate-sequence Mean gives you the luminosity mask.
The line continuation characters "^" are for Windows in my example. Adjust yours accordingly.
s.