GNU bug report logs - #67968
[PATCH] A small patch to make emacs support transparent image (png, webp, svg)

Previous Next

Package: emacs;

Reported by: Qiutum <zh4710jj <at> gmail.com>

Date: Fri, 22 Dec 2023 11:47:01 UTC

Severity: wishlist

Tags: patch

Full log


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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Qiutum <zh4710jj <at> gmail.com>
Cc: 67968 <at> debbugs.gnu.org
Subject: Re: bug#67968: [PATCH] A small patch to make emacs support
 transparent image (png, webp, svg)
Date: Sun, 24 Dec 2023 06:36:51 -0800
Qiutum <zh4710jj <at> gmail.com> writes:

> Hi everyone,
>
> Recently, I've been reading the code of image.c and wondering how to make emacs support transparent image. Then I find that a small change on the
> src/image.c can make it worked (and wonder why this have not been solved since the solution is so simple).
>
> This patch can support the transparent png, webp and svg. The core of the patch is to change the code,
>
>  PUT_PIXEL (mask_img, x, y, *p > 0 ? PIX_MASK_DRAW : PIX_MASK_RETAIN);
>
> to
>
>  PUT_PIXEL (mask_img, x, y, *p > 0 ? *p : PIX_MASK_RETAIN);
>
> Then all worked like a magic.
>
> I have checked my patch in linux by default configure option "../configure" for dwm and pgtk build for hyprland, both are fine. I don't know whether it
> could support other platforms since I don't have them.
>
> Please check my patch and happy to hear comments.

I thought we already supported transparency in png, webp and svg?

Could you please explain more about the problem you are trying to solve?




This bug report was last modified 124 days ago.

Previous Next


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