GNU bug report logs - #57166
Support image :transform-smoothing on MS-Windows

Previous Next

Package: emacs;

Reported by: awrhygty <at> outlook.com

Date: Sat, 13 Aug 2022 06:12:02 UTC

Severity: wishlist

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.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 57166 in the body.
You can then email your comments to 57166 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#57166; Package emacs. (Sat, 13 Aug 2022 06:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to awrhygty <at> outlook.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 13 Aug 2022 06:12:02 GMT) Full text and rfc822 format available.

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

From: awrhygty <at> outlook.com
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1; image :transform-smoothing dose not work
Date: Sat, 13 Aug 2022 15:06:07 +0900
[Message part 1 (text/plain, inline)]
I tried image smoothing, but no intermediate colors are displayed.
The attached image is the result of the form below.

(let ((xpm "/* XPM */
static char *data[] = {
\"4 8 2 1\",
\"  c #FFFFFF\",
\"R c #FF0000\",
\"   R\",
\"   R\",
\"  RR\",
\"  RR\",
\" RRR\",
\" RRR\",
\"RRRR\",
\"RRRR\"}"))
  (insert-image (create-image xpm 'xpm t :scale 1.5
                              :transform-smoothing t)))

[nosmoothing.png (image/png, attachment)]
[Message part 3 (text/plain, inline)]


In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
 of 2022-04-22 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Pro (v10.0.2009.19044.1889)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation
 --without-compress-install CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
  value of $LANG: JPN
  locale-coding-system: cp932

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils term/bobcat find-func noutline outline easy-mmode
view thingatpt cl-extra seq byte-opt gv bytecomp byte-compile cconv
novice mule-util help-mode cl-loaddefs cl-lib japan-util iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 68756 5924)
 (symbols 48 7113 1)
 (strings 32 22330 1664)
 (string-bytes 1 733632)
 (vectors 16 15734)
 (vector-slots 8 340218 10640)
 (floats 8 87 147)
 (intervals 56 736 46)
 (buffers 992 13))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Sat, 13 Aug 2022 06:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: awrhygty <at> outlook.com
Cc: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Sat, 13 Aug 2022 09:24:28 +0300
tags 57166 wishlist
thanks

> From: awrhygty <at> outlook.com
> Date: Sat, 13 Aug 2022 15:06:07 +0900
> 
> I tried image smoothing, but no intermediate colors are displayed.

:transform-smoothing is not yet implemented for MS-Windows, so this is
not a bug, but a missing feature.  Patches welcome.




Changed bug title to 'Support image :transform-smoothing on MS-Windows' from '28.1; image :transform-smoothing dose not work' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 18 Aug 2022 18:28:03 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 18 Aug 2022 18:45:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Mon, 04 Nov 2024 19:20:02 GMT) Full text and rfc822 format available.

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

From: Cecilio Pardo <cpardo <at> imayhem.com>
To: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Mon, 4 Nov 2024 20:19:11 +0100
[Message part 1 (text/plain, inline)]
This patch adds support for :transform-smoothing on windows using GDI+
(since XP).

It converts the HBITMAP to GpBitmap everytime its drawn. We could keep
it around for speed, but take more resources.  Since this may be used on
machines with small memmory, I think its better this way.
[0001-Support-transform-smoothing-on-images-MS-Windows-bug.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Mon, 04 Nov 2024 19:50:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cecilio Pardo <cpardo <at> imayhem.com>
Cc: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Mon, 04 Nov 2024 21:47:19 +0200
> Date: Mon, 4 Nov 2024 20:19:11 +0100
> From: Cecilio Pardo <cpardo <at> imayhem.com>
> 
> This patch adds support for :transform-smoothing on windows using GDI+
> (since XP).

Thanks, this needs a NEWS entry.

> +			  GdipSetInterpolationMode (graphics,
> +						    InterpolationModeHighQualityBicubic);

I wonder why you decided to go with this interpolation mode.  AFAIU,
other platforms use bilinear filtering.  Should the Windows port
produce results similar to the other platforms, or should it produce
the best possible results?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Mon, 04 Nov 2024 20:09:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: cpardo <at> imayhem.com
Cc: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Mon, 04 Nov 2024 22:07:47 +0200
> Cc: 57166 <at> debbugs.gnu.org
> Date: Mon, 04 Nov 2024 21:47:19 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > +			  GdipSetInterpolationMode (graphics,
> > +						    InterpolationModeHighQualityBicubic);
> 
> I wonder why you decided to go with this interpolation mode.  AFAIU,
> other platforms use bilinear filtering.  Should the Windows port
> produce results similar to the other platforms, or should it produce
> the best possible results?

And another question: does this work even when
w32-use-native-image-API is nil?  IOW, does smoothing work for images
produced by external libraries such as libpng and libjpeg?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Mon, 04 Nov 2024 23:04:02 GMT) Full text and rfc822 format available.

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

From: Cecilio Pardo <cpardo <at> imayhem.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Tue, 5 Nov 2024 00:03:36 +0100
On 04/11/2024 20:47, Eli Zaretskii wrote:
>> +			  GdipSetInterpolationMode (graphics,
>> +						    InterpolationModeHighQualityBicubic);
> 
> I wonder why you decided to go with this interpolation mode.  AFAIU,
> other platforms use bilinear filtering.  Should the Windows port
> produce results similar to the other platforms, or should it produce
> the best possible results?

It should be bilinear. Documentation says it should be equivalent to 
bilinear. I'm going with HighQualityBilinear, just Bilinear does not 
look good.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Mon, 04 Nov 2024 23:05:02 GMT) Full text and rfc822 format available.

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

From: Cecilio Pardo <cpardo <at> imayhem.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Tue, 5 Nov 2024 00:04:45 +0100

On 04/11/2024 21:07, Eli Zaretskii wrote:
>> Cc: 57166 <at> debbugs.gnu.org
> And another question: does this work even when
> w32-use-native-image-API is nil?  IOW, does smoothing work for images
> produced by external libraries such as libpng and libjpeg?

Yes, it does.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57166; Package emacs. (Mon, 04 Nov 2024 23:13:01 GMT) Full text and rfc822 format available.

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

From: Cecilio Pardo <cpardo <at> imayhem.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57166 <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Tue, 5 Nov 2024 00:11:52 +0100
[Message part 1 (text/plain, inline)]
New patch with NEWS entry and bilinear interpolation.


[0001-Support-transform-smoothing-on-images-MS-Windows-bug.patch (text/plain, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Tue, 05 Nov 2024 12:42:01 GMT) Full text and rfc822 format available.

Notification sent to awrhygty <at> outlook.com:
bug acknowledged by developer. (Tue, 05 Nov 2024 12:42:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Cecilio Pardo <cpardo <at> imayhem.com>
Cc: 57166-done <at> debbugs.gnu.org
Subject: Re: bug#57166: 28.1; image :transform-smoothing dose not work
Date: Tue, 05 Nov 2024 14:41:28 +0200
> Date: Tue, 5 Nov 2024 00:11:52 +0100
> Cc: 57166 <at> debbugs.gnu.org
> From: Cecilio Pardo <cpardo <at> imayhem.com>
> 
> New patch with NEWS entry and bilinear interpolation.

Thanks, installed on the master branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 04 Dec 2024 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 157 days ago.

Previous Next


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