Amazing, EWA triangle (which sucks for upsampling), does a good job for this test image:
Code: Select all
convert 69543104.bHSz3aSK.Downsampletestimage.jpg \
-filter triangle \
+distort affine '0,0,0,0 %w,0 800,0' \
With a support equal to the disk of diameter 2, this is most likely the fastest EWA (save nearest neighbour EWA, which I'm pretty sure will give dreadful results). On my crusty laptop, it runs in 1.720s compared to 1.523s for plain vanilla resize.
Honestly, I find extremely pleasing the result with EWA triangle. It is remarkably artifact-free.
Yes, EWA lanczos (or resize lanczos) is "snappier," but it does have obvious haloing, and it does have the "saturated" sharpened look, which EWA triangle escapes.
So, although my "no windowing needed when downsampling" hunch did not quite work out for sinc and jinc, it turns out that it does work for EWA triangle: there is no trace in the resulting image of the fact that the triangle basis function is not smooth (only continuous).
This also holds if using -filter triangle -resize, which gives slightly blurrier results which are otherwise fine.
(Most likely, I just rediscovered what some know already, namely that filtering with the hat function gives good results if one is far enough from upsampling. triangle, and quadratic, are approximations of Gaussian blur, esp. when used with distort, so the above is not that different from some of what is recommended here: http://www.imagemagick.org/Usage/resize/#best_filter