GNU bug report logs - #38394
Fwd: Use different image filtering when zooming in vs zooming out

Previous Next

Package: emacs;

Reported by: Alan Third <alan <at> idiocy.org>

Date: Tue, 26 Nov 2019 21:42:02 UTC

Severity: normal

Merged with 39736

Found in version 27.0.60

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38394 in the body.
You can then email your comments to 38394 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Tue, 26 Nov 2019 21:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Third <alan <at> idiocy.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Nov 2019 21:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Emacs Bug Reports <bug-gnu-emacs <at> gnu.org>
Subject: Fwd: Use different image filtering when zooming in vs zooming out
Date: Tue, 26 Nov 2019 21:39:10 +0000
[Message part 1 (text/plain, inline)]
On Tue, Nov 26, 2019 at 09:40:06PM +0100, Adam Sjøgren wrote:
> Alan writes:
>
> > Every time I look at those screenshots I think that perhaps we should
> > turn off the smoothing completely, then remember I turned it on
> > because photos of real things looked awful without it.
>
> Good point.
>
> But hard to tell whether to smooth or not, I guess? xpm's are probably
> often not-photos, but png's...

It might be worth smoothing on scaling down, but not on scaling up.
That way if you zoom in you get exact pixels, but zooming out you
don’t get aliasing effects.

I don’t know if that would add any other problems...

Patch attached ‐ this goes on top of the patch for bug#38109:

    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38109#137

It is also only for XRender. I’ve no idea how to go about doing it in
other terms.
-- 
Alan Third
[Message part 2 (text/html, inline)]
[0001-Don-t-smooth-images-when-zooming-in.patch (application/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Wed, 27 Nov 2019 12:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Wed, 27 Nov 2019 13:32:15 +0100
Alan Third <alan <at> idiocy.org> writes:

> It might be worth smoothing on scaling down, but not on scaling up.
> That way if you zoom in you get exact pixels, but zooming out you
> don’t get aliasing effects.

I think that makes sense, but I wonder whether some people would think
that zoomed-in images then look "blocky"?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Mon, 02 Dec 2019 13:06:01 GMT) Full text and rfc822 format available.

Message #11 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Mon, 2 Dec 2019 13:05:16 +0000
On Wed, Nov 27, 2019 at 01:32:15PM +0100, Lars Ingebrigtsen wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > It might be worth smoothing on scaling down, but not on scaling up.
> > That way if you zoom in you get exact pixels, but zooming out you
> > don’t get aliasing effects.
> 
> I think that makes sense, but I wonder whether some people would think
> that zoomed-in images then look "blocky"?

I think I’d expect to see pixels if I zoomed in rather than a blurry
mess, but that may just be me.

I tried to implement this on the NS port and failed, although I’m sure
it’s possible. I really don’t know if it’s worth bothering with.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Thu, 05 Dec 2019 10:03:01 GMT) Full text and rfc822 format available.

Message #14 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Thu, 05 Dec 2019 11:02:02 +0100
Alan Third <alan <at> idiocy.org> writes:

>> I think that makes sense, but I wonder whether some people would think
>> that zoomed-in images then look "blocky"?
>
> I think I’d expect to see pixels if I zoomed in rather than a blurry
> mess, but that may just be me.

I'd prefer that, too, but it's not what systems software commonly does,
I think?  For instance, the Apple OS-es aggressively blurify when
upscaling images.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Merged 38394 39736. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Mon, 24 Feb 2020 19:03:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Sun, 02 Aug 2020 17:53:02 GMT) Full text and rfc822 format available.

Message #19 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Sun, 02 Aug 2020 19:52:25 +0200
Alan Third <alan <at> idiocy.org> writes:

> It might be worth smoothing on scaling down, but not on scaling up.
> That way if you zoom in you get exact pixels, but zooming out you
> don’t get aliasing effects.
>
> I don’t know if that would add any other problems...

You apparently didn't apply this patch?

[...]

> * src/image.c (image_set_transform [HAVE_XRENDER]): Use different filter
> when zooming in vs zooming out.

I think it makes sense...  although I'm not sure of what the effects are
if you just increase the image size by, say, a couple percent.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Sun, 02 Aug 2020 20:36:02 GMT) Full text and rfc822 format available.

Message #22 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Sun, 2 Aug 2020 21:35:15 +0100
[Message part 1 (text/plain, inline)]
On Sun, Aug 02, 2020 at 07:52:25PM +0200, Lars Ingebrigtsen wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > It might be worth smoothing on scaling down, but not on scaling up.
> > That way if you zoom in you get exact pixels, but zooming out you
> > don’t get aliasing effects.
> >
> > I don’t know if that would add any other problems...
> 
> You apparently didn't apply this patch?

There didn't appear to be much enthusiasm so I just left it in case
someone requested it in the future.

> > * src/image.c (image_set_transform [HAVE_XRENDER]): Use different filter
> > when zooming in vs zooming out.
> 
> I think it makes sense...  although I'm not sure of what the effects are
> if you just increase the image size by, say, a couple percent.

I've attached an updated version of this patch and a screenshot
showing the result with a couple of levels of scaling.

Annoyingly we now use Cairo by default which is unaffected by this
change, so only plain X users will see this behaviour.
-- 
Alan Third
[scaling.png (image/png, attachment)]
[0001-Don-t-smooth-images-when-scaling-up-bug-38394.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Mon, 03 Aug 2020 06:11:01 GMT) Full text and rfc822 format available.

Message #25 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Mon, 03 Aug 2020 08:10:28 +0200
Alan Third <alan <at> idiocy.org> writes:

> I've attached an updated version of this patch and a screenshot
> showing the result with a couple of levels of scaling.

That looks fine to me.

> Annoyingly we now use Cairo by default which is unaffected by this
> change, so only plain X users will see this behaviour.

Oh, I didn't know that...  so this would make the plain X users (a very
small minority now, I guess) have different "embiggening" scaling than
all the rest?  There's no way to make Cairo not do the ultra-smoothing
that it does now? 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Mon, 03 Aug 2020 10:18:01 GMT) Full text and rfc822 format available.

Message #28 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Mon, 3 Aug 2020 10:10:06 +0100
[Message part 1 (text/plain, inline)]
On Mon, Aug 03, 2020 at 08:10:28AM +0200, Lars Ingebrigtsen wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > Annoyingly we now use Cairo by default which is unaffected by this
> > change, so only plain X users will see this behaviour.
> 
> Oh, I didn't know that...  so this would make the plain X users (a very
> small minority now, I guess) have different "embiggening" scaling than
> all the rest?  There's no way to make Cairo not do the ultra-smoothing
> that it does now? 

It should be possible, I just don't know how. I've never done any
Cairo work before...

Turned out to be pretty simple. Patch attached.
-- 
Alan Third
[v2-0001-Don-t-smooth-images-when-scaling-up-bug-38394.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Mon, 03 Aug 2020 14:06:02 GMT) Full text and rfc822 format available.

Message #31 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Mon, 03 Aug 2020 16:04:56 +0200
>>>>> On Mon, 3 Aug 2020 10:10:06 +0100, Alan Third <alan <at> idiocy.org> said:

    Alan> diff --git a/src/image.c b/src/image.c
    Alan> index e7e0a93313..a6b24e6652 100644
    Alan> --- a/src/image.c
    Alan> +++ b/src/image.c
    Alan> @@ -259,6 +259,8 @@ cr_put_image_to_cr_data (struct image *img)
    Alan>  	  cairo_matrix_t matrix;
    Alan>  	  cairo_pattern_get_matrix (img->cr_data, &matrix);
    Alan>  	  cairo_pattern_set_matrix (pattern, &matrix);
    Alan> +          cairo_pattern_set_filter
    Alan> +            (pattern, cairo_pattern_get_filter (img->cr_data));
    Alan>  	  cairo_pattern_destroy (img->cr_data);
    Alan>  	}
    Alan>        cairo_surface_destroy (surface);
    Alan> @@ -2114,6 +2116,15 @@ image_set_transform (struct frame *f, struct image *img)
    Alan>    double rotation = 0.0;
    Alan>    compute_image_rotation (img, &rotation);
 
    Alan> +# if defined HAVE_XRENDER
    Alan> +  /* We want scale up operations to use a nearest neighbour filter to
    Alan> +     show real pixels instead of munging them, but scale down
    Alan> +     operations to use a blended filter, to avoid aliasing and the like.
    Alan> +
    Alan> +     TODO: implement for NS and Windows.  */
    Alan> +  bool scale_down = (width < img->width) || (height < img->height);
    Alan> +# endif
    Alan> +
    Alan>    /* Perform scale transformation.  */
 
    Alan>    matrix3x3 matrix
    Alan> @@ -2230,6 +2241,8 @@ image_set_transform (struct frame *f, struct image *img)
    Alan>  			      matrix[1][1], matrix[2][0], matrix[2][1]};
    Alan>    cairo_pattern_t *pattern = cairo_pattern_create_rgb (0, 0, 0);
    Alan>    cairo_pattern_set_matrix (pattern, &cr_matrix);
    Alan> +  cairo_pattern_set_filter (pattern, scale_down

Isnʼt scale_down only defined if HAVE_XRENDER? This usage is under
USE_CAIRO




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Mon, 03 Aug 2020 18:19:02 GMT) Full text and rfc822 format available.

Message #34 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 38394 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Mon, 3 Aug 2020 16:13:50 +0100
On Mon, Aug 03, 2020 at 04:04:56PM +0200, Robert Pluim wrote:
> 
> Isnʼt scale_down only defined if HAVE_XRENDER? This usage is under
> USE_CAIRO

I'm not sure if you can have Cairo without XRender at the moment, but
I'll make it explicit.

Thanks!
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Mon, 03 Aug 2020 19:56:02 GMT) Full text and rfc822 format available.

Message #37 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Mon, 03 Aug 2020 21:55:39 +0200
>>>>> On Mon, 3 Aug 2020 16:13:50 +0100, Alan Third <alan <at> idiocy.org> said:

    Alan> On Mon, Aug 03, 2020 at 04:04:56PM +0200, Robert Pluim wrote:
    >> 
    >> Isnʼt scale_down only defined if HAVE_XRENDER? This usage is under
    >> USE_CAIRO

    Alan> I'm not sure if you can have Cairo without XRender at the moment, but
    Alan> I'll make it explicit.

I donʼt know that either, I only ran the code through my mental
compiler :-)

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Tue, 04 Aug 2020 08:53:01 GMT) Full text and rfc822 format available.

Message #40 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Tue, 04 Aug 2020 10:52:47 +0200
Alan Third <alan <at> idiocy.org> writes:

> It should be possible, I just don't know how. I've never done any
> Cairo work before...
>
> Turned out to be pretty simple. Patch attached.

Then I think this should be applied to Emacs 28, and we'll get some
feedback on whether people prefer it this way or not.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Tue, 04 Aug 2020 19:52:01 GMT) Full text and rfc822 format available.

Notification sent to Alan Third <alan <at> idiocy.org>:
bug acknowledged by developer. (Tue, 04 Aug 2020 19:52:01 GMT) Full text and rfc822 format available.

Message #45 received at 38394-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38394-done <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Tue, 4 Aug 2020 21:51:34 +0200 (CEST)
On Tue, Aug 04, 2020 at 10:52:47AM +0200, Lars Ingebrigtsen wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > It should be possible, I just don't know how. I've never done any
> > Cairo work before...
> >
> > Turned out to be pretty simple. Patch attached.
> 
> Then I think this should be applied to Emacs 28, and we'll get some
> feedback on whether people prefer it this way or not.

I worked out how to do it under NS too, so I've added that and pushed
to master.
-- 
Alan Third




Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Tue, 04 Aug 2020 19:52:01 GMT) Full text and rfc822 format available.

Notification sent to ynyaaa <at> gmail.com:
bug acknowledged by developer. (Tue, 04 Aug 2020 19:52:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Wed, 05 Aug 2020 08:48:02 GMT) Full text and rfc822 format available.

Message #53 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in
 vs zooming out
Date: Wed, 05 Aug 2020 10:47:33 +0200
Alan Third <alan <at> idiocy.org> writes:

> I worked out how to do it under NS too, so I've added that and pushed
> to master.

Great!

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Fri, 14 Aug 2020 06:04:02 GMT) Full text and rfc822 format available.

Message #56 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: David Ponce <da_vid <at> orange.fr>
To: 38394 <at> debbugs.gnu.org
Subject: Fwd: Use different image filtering when zooming in vs zooming out
Date: Fri, 14 Aug 2020 08:03:04 +0200
[Message part 1 (text/plain, inline)]
Hello,

With this patch applied (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=519a93e067f459ceddb57573261a52118086b73d), I noticed that small icon images look bad with image defaut attributes, but look as expected when I add the attribute :scale 1 (see the attached screenshots). The issue is that by default on an HiDPI screen, images are scaled up (in my configuration the default scale is 1.2).

I don't know if there is a way to force the smoothing behavior, if not, maybe an image attribute could be considered ?

Thanks!
[Screenshot_default-scale1.2.png (image/png, attachment)]
[Screenshot_scale1.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Fri, 14 Aug 2020 20:21:02 GMT) Full text and rfc822 format available.

Message #59 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: David Ponce <da_vid <at> orange.fr>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Fri, 14 Aug 2020 22:20:34 +0200 (CEST)
On Fri, Aug 14, 2020 at 08:03:04AM +0200, David Ponce wrote:
> Hello,
> 
> With this patch applied
> (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=519a93e067f459ceddb57573261a52118086b73d),
> I noticed that small icon images look bad with image defaut
> attributes, but look as expected when I add the attribute :scale 1
> (see the attached screenshots). The issue is that by default on an
> HiDPI screen, images are scaled up (in my configuration the default
> scale is 1.2).
> 
> I don't know if there is a way to force the smoothing behavior, if
> not, maybe an image attribute could be considered ?

Is this on X?

Maybe we should only go to nearest neighbour when the scaling is >= 2?
Or greater than the scale factor? Hmm, I'm not sure what's best here.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Fri, 14 Aug 2020 21:15:01 GMT) Full text and rfc822 format available.

Message #62 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: David Ponce <da_vid <at> orange.fr>
To: Alan Third <alan <at> idiocy.org>, 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Fri, 14 Aug 2020 23:14:22 +0200
On 14/08/2020 22:20, Alan Third wrote:
> On Fri, Aug 14, 2020 at 08:03:04AM +0200, David Ponce wrote:
>> Hello,
>>
>> With this patch applied
>> (https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=519a93e067f459ceddb57573261a52118086b73d),
>> I noticed that small icon images look bad with image defaut
>> attributes, but look as expected when I add the attribute :scale 1
>> (see the attached screenshots). The issue is that by default on an
>> HiDPI screen, images are scaled up (in my configuration the default
>> scale is 1.2).
>>
>> I don't know if there is a way to force the smoothing behavior, if
>> not, maybe an image attribute could be considered ?
> 	
> Is this on X?

Yes, here are the Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER LCMS2

> 
> Maybe we should only go to nearest neighbour when the scaling is >= 2?
> Or greater than the scale factor? Hmm, I'm not sure what's best here.
> 

Not sure either.
Maybe an option could define the min scale to go to nearest neighbour?
By default (nil?) it could be the scale factor?

An image attribute could make sense too, similar to :scale, but for smoothing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Fri, 14 Aug 2020 23:11:02 GMT) Full text and rfc822 format available.

Message #65 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: David Ponce <da_vid <at> orange.fr>
Cc: 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Sat, 15 Aug 2020 01:10:17 +0200 (CEST)
On Fri, Aug 14, 2020 at 11:14:22PM +0200, David Ponce wrote:
> On 14/08/2020 22:20, Alan Third wrote:
> > Maybe we should only go to nearest neighbour when the scaling is >= 2?
> > Or greater than the scale factor? Hmm, I'm not sure what's best here.
> > 
> 
> Not sure either.
> Maybe an option could define the min scale to go to nearest neighbour?
> By default (nil?) it could be the scale factor?
> 
> An image attribute could make sense too, similar to :scale, but for smoothing.

Can you try replacing this line (2125):

    bool scale_down = (width < img->width) || (height < img->height);

with

    bool scale_down = (double)width/img->width < 1.2;

and have a play about with the number and see how it looks?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38394; Package emacs. (Sat, 15 Aug 2020 07:05:02 GMT) Full text and rfc822 format available.

Message #68 received at 38394 <at> debbugs.gnu.org (full text, mbox):

From: David Ponce <da_vid <at> orange.fr>
To: Alan Third <alan <at> idiocy.org>, 38394 <at> debbugs.gnu.org
Subject: Re: bug#38394: Fwd: Use different image filtering when zooming in vs
 zooming out
Date: Sat, 15 Aug 2020 09:04:50 +0200
On 15/08/2020 01:10, Alan Third wrote:
> On Fri, Aug 14, 2020 at 11:14:22PM +0200, David Ponce wrote:
>> On 14/08/2020 22:20, Alan Third wrote:
>>> Maybe we should only go to nearest neighbour when the scaling is >= 2?
>>> Or greater than the scale factor? Hmm, I'm not sure what's best here.
>>>
>>
>> Not sure either.
>> Maybe an option could define the min scale to go to nearest neighbour?
>> By default (nil?) it could be the scale factor?
>>
>> An image attribute could make sense too, similar to :scale, but for smoothing.
> 
> Can you try replacing this line (2125):
> 
>      bool scale_down = (width < img->width) || (height < img->height);
> 
> with
> 
>      bool scale_down = (double)width/img->width < 1.2;
> 
> and have a play about with the number and see how it looks?
> 

I did try your change. With value 1.2 (the default scale factor on my configuration) images look smooth.
They don't, as soon as I change the image scaling to be greater than 1.2.

IMO, regardless of the scaling it is important to have a way to control how some kind of images will look, like UI elements which must always look smoothed.
So, an option to control this is important in such cases, regardless of the scaling factor.
It should be possible to use small icons scaled by 1.5 or 2 for example, for UI elements.
And such UI elements should still look good, even if the default scaling factor is less than 1.5.

Thanks!





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 Sep 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.