GNOME Bugzilla – Bug 80923
HYPER is not correctly implemented
Last modified: 2018-05-22 13:01:30 UTC
From gdk-pixbuf/pixops/README: * ART_FILTER_HYPER is not correctly implemented. It is currently implemented as a filter that is derived by doing linear interpolation on the source image and then averaging that with a box filter. It should be defined as followed (see art_filterlevel.h) "HYPER is the highest quality reconstruction function. It is derived from the hyperbolic filters in Wolberg's "Digital Image Warping," and is formally defined as the hyperbolic-filter sampling the ideal hyperbolic-filter interpolated image (the filter is designed to be idempotent for 1:1 pixel mapping). It is the slowest and highest quality." The current HYPER is probably as slow, but lower quality. Also, there are some subtle errors in the calculation current HYPER that show up as dark stripes if you scale a constant-color image.
Not only that, but the current hyper implementation is infact *not* idempotent for the 1:1 case - at least in the context of a gdk_pixbuf_composite operation. This came to our attention because the latest release of libgnomecanvas switched from BILINEAR to HYPER resulting in lower quality rendering of our svg pixbufs which we manually scale (by re-rendering with librsvg) to the required size on zoom actions. So we know that gnome canvas is always doing a 1:1 scaling when compositing them (and I added debug output to verify this). I will attach screenshots and the actual svg file, and I will file a separate bug against gnomecanvas suggesting a switch back to BILINEAR until HYPER is fixed.
Created attachment 53036 [details] The SVG file used for the rendering
Created attachment 53037 [details] Screenshot comparing the rendering. BILINEAR is on the left and HYPER is on the right. We observe that a) they aren't the same but they ought to be, and b) the BILINEAR one is crisper and clearer.
If that's true, LART whoever made the gnome-canvas change. HYPER should not be used.
Indeed. I have reopened bug 129891 accordingly. It requested that "better interpolation be used". Clearly, this has not been satisfied yet :-) For completeness' sake, they actually used NEAREST before HYPER but BILINEAR and NEAREST look identical for 1:1.
We should really deprecate HYPER, then. The thumbnailer code uses it, and it shouldn't.
(In reply to Emmanuele Bassi (:ebassi) from comment #6) > We should really deprecate HYPER, then. The thumbnailer code uses it, and it > shouldn't. The poor person that implemented the thumbnailer went by the API documentation rather than the bugs filed. Removing it would have been a nice thing to do in 2010 when gdk-pixbuf was split off. Now, where's my time machine?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/3.