Regarding GEGL Bug 550569 – Su ggested replacement for Lanczos, and possibly cubic: Yet An other Fast Resampler
http://bugzilla.gnome.org/show_bug.cgi?id=550569
includes gegl C code and pointers to image enlargement test code and results for a high quality (non linear) image resampling code (Yet Another Fast Resampler).
The first post contained slightly non-optimized code, the second, faster code with a bug. For this reason, use the code found in Comment #3.
Main features:
The new method is quite flexible: It has two parameters, like cubic splines, which I call "smooth" and "straighten" but which I think I may rename "smooth" and "antialias" (the first one primarily has to do with subpixel smoothing, the second, smoothing at a scale comparable to the distance between pixels. On the basis of limited testing on a processed digital photograph and a "text like" image, it appears that with the theoretically optimal values of the parameters (one of which has to be computed more precicely: complex integrals are involved in the exact computation) give excellent results. These approximate optimal values are smooth = .85 and straighten = 14.27; see the corresponding results for these values first.
When substituted for the gegl-sampler-cubic.c code, scale (run from xml) runs a smidgen faster than the stock gegl cubic, and 10-15% slower than stock gegl bilinear.
When smooth = 0 and straighten = 1, the method is co-convex (does not introduce kinks).
When smooth = 0 and straighten look in general.
Comments, inquiries etc welcome.
Nicolas Robidoux
Laurentian University/University Laurentienne.