fwm42 wrote:Is EWA now resolved for the time being?
Yes it has. and things have settled.
The second improvement announcement was the switch from the HQ-EWA technique (very blurry for almost no distort cases) to a Lower bound Clamped EWA.
As Clamped-EWA now works and works in a way that is equivalent to normal orthogonal resizing, different filters than a blurry Gaussian could now be used.
After lengthly discussions with Nicholas Robidoux, Professor of Mathematics at Laurentian University, the default filter has switched from Gaussian to a 'Mitchell-like' Robidoux filter, which was mathematically designed to have a minimal-blur for a minimal-distort case.
Cylindrical Interpolative methods such as Triangle, or the Hermite filter, or even a Gaussian filter with a "-define filter:blur=0.5" can also be used. Though any interpolation method will produce some aliasing effects in areas of high minification (image shrinking).
Could you add some more notes or clarification on your page about -distorts and EWA? For example:
1) I am confused about the use of -filter. Does that now change from using EWA to some -resize filter or does it change the Gaussian to something else such as cylindrical lanczos or spline or whatever within EWA
-filter changes the filter being used for either Resize or for Distort.
"-filter Point" turns of the use of filters in both as well, though for resize it only falls back to a nearest neighbour interpolation where in distort it will fall back to the -interpolate setting.
Up until these changes to distort, changing the -filter setting did not really do anything due to the extreme blurriness of the technique being used, especial in a 'no distort' case. It was something that I found annoying for years. The only solution for it however requires heavy use of trigonometric functions, which I was lothed to implement. Major thanks goes to Nicholas for working out a matrix solution (Singular decomposition) to the problem. After all, I am not really a mathematician.
Now the default distort output is very sharp, with only a minimal amount of blur for a 'no distort' case, and changing the filter and the various filter expert options can produce a marked change in results, allowing for the direct generation of very high quality distortions.
The Distort notes detail this in IM Examples, Distort Operator,
EWA Resampling and Filters which was re-written about a week ago. People are always welcome to submit additions, changes or spelling corrections to any IM examples. I may not respond quickly or use them as given, but they are always welcome.
Also see the new
Cylindrical Filters pages.
2) What is the current filter used by EWA as default? Is it cylindrical lanczos, Gaussian or the spline approx?
As of IM v6.6.5-0 it is the Robidoux Filter which happens to be almost identical to the Mitchell filter used for resize.
Both are Cubic 'Keys' filters, with almost the same 'C' (keys alpha) value.
The only difference between them is that Mitchell was chosen using social engineering to find an acceptable filter that works well for orthogonal 2-pass image resizing.
Robidoux however was specifically designed to act like a 2-lobe cylindrical Lanczos filter (Lanczos2D) that was sharpened to remove the detrimental effects windowing has on the Jinc function, and generate only minimal blurring for edges in a no-distort case.
See Windowed Jinc Cylindrical Filters
http://www.imagemagick.org/Usage/resize/#jinc
3) Can you add one or two examples of using a different expert option to change the filter used by EWA for different types of image.
Working on that (slowly)...
See the new section in IM examples, Cylindrical Filters
http://www.imagemagick.org/Usage/resize ... ylindrical
4) What is now being done when the foreground is magnified and the background is minified?
The automatic switch between EWA filtering, and interpolation has been removed. It is no longer relevant now that Clamped-EWA is in use.
You will either use EWA filtering or unscaled orthogonal Interpolation. Both produce excellent results for magnification (upsampling), though only EWA filters produce good results for minification (shrinking, or down sampling).
5) Can one avoid using EWA and just use one of the normal -filters such as triangle or normal 1d lanczos? If so, how do you do that?
WIthout EWA resampling, you can NOT use a filter. Only a unscaled interpolate looking of a the single sampled point. This will work reasonably well for no or magnification, but will produce serious aliasing effects for string. minification.
You can turn of EWA by using "-filter point". The "-interpolate Bilinear" (triangle filter equivalent) is the default
interpolator.
Alternately you can leave EWA enabled and use the "-filter triangle" Interpolation filter for BOTH magnification and minification. This will however be a 'cylindrical' interpolation rather than a two pass orthogonal interpolate. This will also handle 'minification' much more gracefully than any unscaled interpolate method.
A 1D Lanzcos (Sinc windowed Sinc) is not available as a interpolator. The closest available interpolator is 'Bicubic' which is based on a order-3 (2 lobe) Langrange filter. Lanczos is really ment to be used as a scaled area sampling filter, using either a 2-pass 1-d method (resize), but a 'cylindrical lanczos' (Jinc Windowed Jinc) can be used for a 1 pass 2 dimentional method (distort).
If any rotation is involved any type complex 1D filters do not work very well, they are just not designed for it, and especially not for a distorted 'circle' or elliptical area. If no rotation is involved, then you may as well just Resize the image!
6) Can you change what is used for magnification by -interpolate?
You either use EWA filtering or use interpolation, for the whole image.
Their is no auto-switch, as this tends to create image artifacts at the switch over point, as was seen in both large rings image shown in the first discussion..
Major Distort Image Improvement!
That switch was especially noticable near the bottom of the OLD image
http://dl.dropbox.com/u/9500683/rings_fixed.png
ASIDE: Have a look at these two animations.
The first is with The old Rotate operator, The second is generated using the "-distort SRT" with default settings.

These are in IM Examples, Image Warping Animations
http://www.imagemagick.org/Usage/warping/#animations
Apart from its overall blurriness, the rotate operators 'jiggle' is especially annoying. It was something that was reported and fixed years and years ago, but seems to have returned for some reason.