Subject: bug#77104: 31.0.50; Transparent png image background is ignored in frames with alpha-background

From: Ihor Radchenko <[email-masked]>
Date: Tue, 18 Mar 2025 18:03:23 +0000

Try the following starting from emacs -Q + the attached .png file:

1.

(let ((ov (make-overlay 1 10)))
  (set-frame-parameter nil 'alpha-background 90)
  (overlay-put
   ov
   'display
   (create-image
    "/path/to/image.png"
    nil nil :width 100)))

2. Observe image background not being transparent, but instead using
default face background.

3.

(let ((ov (make-overlay 1 10)))
  (set-frame-parameter nil 'alpha-background 90)
  (overlay-put
   ov
   'display
   (create-image
    "/path/to/image.png"
    nil nil :width 100 :mask 'heuristic)))

4. With :mask 'heuristic, the background becomes transparent (mod
"rough" edges due to clipping)

I believe that (1) is a bug.

See also https://list.orgmode.org/orgmode/[email-masked]/

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.42, cairo version 1.18.2) of 2025-03-16 built on localhost
Repository revision: 52879c61e961cac71e7bb0ba12b73f6dd4f28877
Repository branch: scratch/markers-as-gap-array
Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
System Description: Gentoo Linux

Configured using:
 'configure --with-tree-sitter --with-native-compilation 'CFLAGS=-g3
 -I/opt/mps/include -L/opt/mps/lib'
 JAVAC=/etc/java-config-2/current-system-vm/bin/javac
 PKG_CONFIG_PATH=/usr/share/guile-data/3.0/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>