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.
How to "Smart Sharpen," adaptive-sharpen not working
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to "Smart Sharpen," adaptive-sharpen not working
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.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 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to "Smart Sharpen," adaptive-sharpen not working
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).
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).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to "Smart Sharpen," adaptive-sharpen not working
try -gamma or -evaluate powIt could possibly benefit from a curves adjust after the contrast stretch (done with linear stretch).
or my curves script
Re: How to "Smart Sharpen," adaptive-sharpen not working
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to "Smart Sharpen," adaptive-sharpen not working
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
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
Hello,fmw42 wrote:Have you tried my gaussedge or sharpedge scripts? Curious how they compare to adaptive-sharpen!
Where can I found your scripts to test and use them?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to "Smart Sharpen," adaptive-sharpen not working
See the link at the bottom of my post.3aHyga wrote:Hello,fmw42 wrote:Have you tried my gaussedge or sharpedge scripts? Curious how they compare to adaptive-sharpen!
Where can I found your scripts to test and use them?
Re: How to "Smart Sharpen," adaptive-sharpen not working
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.
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.