NicolasRobidoux wrote:Haloing is less of an issue when downsampling.
Can we have/do we need separate default filters for upsampling and downsampling?
Answer 1: In a nutshell, this is what I programmed for the GEGL library. The result of resampling with a scheme acceptable for downsampling (EWA Triangle) is blended with the result of a scheme acceptable for upsampling (the nonlinear LBB-Nohalo method), with the blending dependent on the EWA ellipse: http://git.gnome.org/browse/gegl/tree/gegl/buffer/gegl-sampler-lohalo.c
. This method replaces Lanczos in the bleeding edge goat-invasion branch of GIMP, meaning that if you click on Lanczos resizing, it silently swaps the lohalo method for it. I don't particularly like EWA Triangle, but gegl-sampler-lohalo.c (which I'll most likely rename gegl-sampler-nohalo.co at some point) is a method which is supposed not to add any haloing, ever. LBB-Nohalo is a halo free upsampler (LBB stands for "Locally Bounded Bicubic"; Nohalo is a subdivision method).
Answer 2: The complication is that some transformations both upsample and downsample: shrink in one direction, stretch in another. Actually, warping can go from one extreme to another within one single image, so you want to switch from one resampling scheme to the other smoothly. A complete implementation is expensive: You need to compute (a reasonable approximation of) the EWA ellipse on a pixel-per-pixel basis.
Answer 3: This being said, one could make a quick and dirty automated judgement call as to whether upsampling or downsampling dominates, and select a global default based on that. This should not be too hard to program.
Answer 4: However, what a good pair would be really depends on what you value most: sharpness? lack of jaggies? little moire? lack of haloing artifacts? few false colours?
It doubles the amount of discussion required to pick a default! (Although I agree that if there is a clear winner in one of the directions which does not do so well in the other, the "doubled discussion" could be shorter.)