search for a decent interpolatory EWA filter

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: search for a decent interpolatory EWA filter

Post by NicolasRobidoux »

The overall lesson of my numerous attempts (some documented here, some not) at constructing a decent interpolatory EWA filter:

This is a nontrivial problem. (Or else, I'm blind.)
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: search for a decent interpolatory EWA filter

Post by NicolasRobidoux »

P.S. It you are going to downsample, or barely upsample, EWA triangle and the Keys one discussed earlier in this thread are probably better choices of interpolatory EWA filters than the "optimal" one.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: search for a decent interpolatory EWA filter

Post by NicolasRobidoux »

Here is a good illustration of this "best so far" interpolatory EWA filter I found (which, once again, is not very good).

Download Image. Now, try this:

Code: Select all

convert sl.png -define filter:blur=.7071067811865475 -define filter:c=.49218815 -define filter:b=2.08817747090797 -filter Cubic -distort Resize 3000% c_optimal_3000percent.png
Neat, eh? Is it clear why I say that it's fine for mild, but not for drastic, upsampling?

Now, before you go "this is complete garbage", compare with

Code: Select all

convert sl.png -filter Triangle -distort Resize 3000% Triangle.png
If you want to compare with non-interpolatory EWA filters:

Code: Select all

convert sl.png -define filter:filter=Jinc -define filter:window=Jinc -define filter:blur=0.88451002338585141 -define filter:lobes=4 -distort Resize 3000% JincJinc4blur0p88451002338585141.png
convert sl.png -define filter:filter=Jinc -define filter:window=Jinc -define filter:blur=0.88549061701764 -define filter:lobes=3 -distort Resize 3000% JincJinc3blur0p88549061701764.png
convert sl.png -filter LanczosSharp -distort Resize 3000% LanczosSharp.png
convert sl.png -filter Robidoux -distort Resize 3000% Robidoux.png
convert sl.png -define filter:c=.3689927438004929 -filter Cubic -distort Resize 3000% RobidouxSharp.png
And this is good old orthogonal (Sinc-windowed Sinc) Lanczos 3:

Code: Select all

convert sl.png -filter Lanczos -resize 3000% orthogonalLanczos3.png
If you compare orthogonalLanczos to, say, RobidouxSharp, you'll get an idea of why I like the latter despite the fact that it is not derived with any consideration of frequency response whatsoever, and why I don't think that orthogonalLanczos is the be all and end all. (A look at the LanczosSharp result will also tell you why I, and others, like it so much.)
Post Reply