Excellent, Bart, now downsampling too.
1) May I ask how the sharpening works? Is it final-size appropriate?
Hi Jack,
Yes, the down-sampling is a little better than with the algorithm that Nicolas suggested, but that algorithm isn't all that bad at down-sampling either (it's just better at up-sampling).
It assumes that you started with a decent image. Then down-sampling will effectively result in oversampled detail (more than 1 input pixel per output pixel, preferably more than 2) , which is guaranteed to be the case below 50% of the original size. That automatically means that the highest possible spatial frequencies in the image are at the Nyquist frequency. What follows is that we need to use a proper resampling filter, of which ImageMagick offers several, for down-sampling in order to avoid aliasing artifacts.
When we can assume that the finest detail is reasonably bandwidth limited (by the filtering) before down-sampling, we can in principle use the same generic post-sharpening for all down-sampled images to mitigate the blur that is inherent in (proper) down-sampling. Deconvolution is a detail
restoration procedure, and a simple non-iterative version of it is High-pass sharpening. Given the purpose of web-publishing, one can 'exaggerate a little', which is subject to taste.
The High-pass implementation I chose, was aimed at doing it's best at the extreme detail case, so it would not be too obvious (less efficient) in lower detail situations, such as between 50-100% of the original size (or larger). The code line:
-define convolve:scale=^65%%,100 -morphology Convolve DoG:0,0,0.45
will add an amount of
65% of the High-pass effect of a
0.45 sigma pixel radius Difference of Gaussians relative to an impulse signal filter. One can vary the amount of 65% to taste by changing the code, or choose a larger radius by changing the radius.
So, yes it is final size appropriate, especially below 50% of the original size, while assuming 'normal' viewing distances.
2) Does it make sense to capture sharpen before a 2-3x downsampling?
No it doesn't, that is, assuming we are talking about Capture sharpening. It might even hurt (by increasing aliasing) when using lower quality resampling filters than the ones offered by ImageMagick. However, with Creative 'sharpening' we usually address larger spatial frequencies and local contrast, which would affect tonality or local contrast more than actual sharpness, and thus would still affect the down-scaled image.
Cheers,
Bart