Skip to content
Permalink
Browse files

EomScrollView: Use better downscaling filter

Replace all instances of CAIRO_FILTER_BILINEAR with CAIRO_FILTER_GOOD.
This produces much less aliasing on downscaled images. CAIRO_FILTER_GOOD
uses the same method as CAIRO_FILTER_BILINEAR for scale factors greater
than 0.75, according to https://bugs.webkit.org/show_bug.cgi?id=147826.

Comparison screenshots made with eog 3.18.1: http://imgur.com/a/NaoOs

CAIRO_FILTER_BEST is better still, but the the visual difference is
almost imperceptible and the performance impact is severe.

https://bugzilla.gnome.org/show_bug.cgi?id=665897

origin commit: https://gitlab.gnome.org/GNOME/eog/commit/fbc1128

fixes #96
  • Loading branch information...
yump authored and raveit65 committed Feb 14, 2016
1 parent f607cda commit 7f38bf69cec41fc54e79819022451897e4f1e09b
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/eom-scroll-view.c
@@ -1411,7 +1411,7 @@ eom_scroll_view_set_antialiasing_in (EomScrollView *view, gboolean state)

priv = view->priv;

new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;

if (priv->interp_type_in != new_interp_type) {
priv->interp_type_in = new_interp_type;
@@ -1430,7 +1430,7 @@ eom_scroll_view_set_antialiasing_out (EomScrollView *view, gboolean state)

priv = view->priv;

new_interp_type = state ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_NEAREST;
new_interp_type = state ? CAIRO_FILTER_GOOD : CAIRO_FILTER_NEAREST;

if (priv->interp_type_out != new_interp_type) {
priv->interp_type_out = new_interp_type;
@@ -1763,8 +1763,8 @@ eom_scroll_view_init (EomScrollView *view)
priv->min_zoom = MIN_ZOOM_FACTOR;
priv->zoom_mode = ZOOM_MODE_FIT;
priv->upscale = FALSE;
priv->interp_type_in = CAIRO_FILTER_BILINEAR;
priv->interp_type_out = CAIRO_FILTER_BILINEAR;
priv->interp_type_in = CAIRO_FILTER_GOOD;
priv->interp_type_out = CAIRO_FILTER_GOOD;
priv->scroll_wheel_zoom = FALSE;
priv->zoom_multiplier = IMAGE_VIEW_ZOOM_MULTIPLIER;
priv->image = NULL;

0 comments on commit 7f38bf6

Please sign in to comment.
You can’t perform that action at this time.