GNU bug report logs -
#67968
[PATCH] A small patch to make emacs support transparent image (png, webp, svg)
Previous Next
Full log
Message #11 received at 67968 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Qiutum,
I can confirm that this patch works great on pgtk (sway). Thank you for
this!
Let me explain the problem it solves. The problem arises mostly for
users of the frame parameter alpha-background. Having set the
alpha-background sufficiently low, it becomes apparent that Emacs
doesn't *really* support transparency for these image types. Instead, it
either fills the background with the background color of the frame (png
& svg) or supports only a binary form of transparency (webp).
Here are some screenshots which show the difference, with
alpha-background set to 50 with
(set-frame-parameter nil 'alpha-background 50)
The svg is created with
(let ((svg (svg-create 100 100 :stroke-width 10)))
(svg-circle svg 50 50 25 :fill "none" :stroke "black")
(insert-image (svg-image svg)))
The png is the logo at
https://de.wikipedia.org/wiki/Portable_Network_Graphics and the webp is
the same image exported to webp.
(I hope these images will show fine in the mailing list.)
SVG before (no transparency):
SVG after:
PNG before (note also that the G is rather gray instead of the correct
blue. The tint seems generally off due to the partial transparency of
the source):
PNG after:
webp before (note the binary transparency):
webp after partial transparency):
Best regards,
Nate
[Message part 2 (text/html, inline)]
[0b5d9bc6.png (image/png, inline)]
[25e3531c.png (image/png, inline)]
[103f5ff5.png (image/png, inline)]
[bbe58141.png (image/png, inline)]
[1006f992.png (image/png, inline)]
[e747bf70.png (image/png, inline)]
This bug report was last modified 123 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.