GNOME Bugzilla – Bug 129891
better interpolation for images should be used
Last modified: 2005-10-06 22:26:41 UTC
gpdf seems to be using nearest neighbor interpolation and that gives very bad output. Using a much better interpolator like GDK_INTERP_HYPER should be at least optional if not default.
That's currently out of my control (the code that would have to be changed is in libgnomeprintui). However, I'm considering to copy that code into gpdf (for other reasons), so this change might become possible.
Is gpdf using gnomeprint to show the document on screen? That would be a bug in gnomeprint, wouldn't it? I've seen the same problem in gnumeric print preview This bug should be reassigned to gnome-print.
I've reassigned to print preview component. I've done a quick search for the image interpolator and I didn't find it. Where's the code that should be changed to allow better interpolation?
Ooops. I was wrong. Not even gnome-print can do anything about the interpolation method, it's hardwired in libgnomecanvas (GnomeCanvasPixbuf) as far as I could see.
Created attachment 22670 [details] [review] Default to Hyper Interpolation
Here's the patch that took hyper interpolation away: http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvs/gnome&subdir=libgnomecanvas%2Flibgnomecanvas&command=DIFF&root=/cvs/gnome&file=gnome-canvas-pixbuf.c&rev1=1.20&rev2=1.21
Please look at this patch.
Is this very visible? I can try the patch and see if it makes a huge difference...
Yes, It's a _HUGE_ difference using HYPER interpolation instead NEAREST interpolation. I can't work with NEAREST anymore in any app. I think you should default to BILINEAR at least. I'd like to have HYPER as default but maybe selection one or the other based on CPU speed would be better idea.
the libart portion of this patch is unneccessary. libart only supports ART_FILTER_NEAREST and is not developed any further. using nearest for gdk is a waste though. this should be at least BILINEAR as daniel said, but we might as well use HYPER since interpolating pixbufs is not one of the performance critical portions of trhe canvas. so the gdk portion of trhe patch sghould be applied: @@ -958,7 +958,7 @@ render_affine[5] - buf->rect.y0, render_affine[0], render_affine[3], - GDK_INTERP_NEAREST, + GDK_INTERP_HYPER, 255); gdk_pixbuf_unref (dest_pixbuf);
Commited that hunk to both branches.
The bug was that better interpolation should be used. The catch is that HYPER is so buggy that BILINEAR is actually the better interpolation.
*** Bug 317968 has been marked as a duplicate of this bug. ***
See bug 317968 and bug 80923 for details.
Fixed on CVS in the gnome-2-12 and HEAD branches. 2005-10-06 Federico Mena Quintero <federico@ximian.com> * libgnomecanvas/gnome-canvas-pixbuf.c (gnome_canvas_pixbuf_render): HYPER interpolation is a slow buggy piece of shit. Use BILINEAR. Fixes bug #129891.