From: Stefan Kangas <stefankangas@gmail.com>
To: Qiutum <zh4710jj@gmail.com>
Cc: 67968@debbugs.gnu.org
Subject: bug#67968: [PATCH] A small patch to make emacs support transparent image (png, webp, svg)
Date: Sun, 24 Dec 2023 06:36:51 -0800 [thread overview]
Message-ID: <CADwFkmk+c61+5NgxcG8ALkyr0FjdveiDCmiTmHSnrhrxG-LVEg@mail.gmail.com> (raw)
In-Reply-To: <CACph+bVEiGK7Mcd1JmsEEN403u=i=cTQagzCemp_tc7wKQtG0w@mail.gmail.com> (Qiutum's message of "Fri, 22 Dec 2023 19:38:09 +0800")
Qiutum <zh4710jj@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?
next prev parent reply other threads:[~2023-12-24 14:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-22 7:18 [PATCH] A small patch to make emacs support transparent image (png, webp, svg) Qiutum
2023-12-22 8:25 ` Manuel Giraud via Emacs development discussions.
2023-12-22 8:59 ` Qiutum
2023-12-22 9:43 ` Manuel Giraud via Emacs development discussions.
2023-12-22 9:49 ` Stefan Kangas
2023-12-22 11:38 ` bug#67968: " Qiutum
2023-12-24 14:36 ` Stefan Kangas [this message]
2024-03-10 20:50 ` nsan
2023-12-22 12:13 ` Po Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADwFkmk+c61+5NgxcG8ALkyr0FjdveiDCmiTmHSnrhrxG-LVEg@mail.gmail.com \
--to=stefankangas@gmail.com \
--cc=67968@debbugs.gnu.org \
--cc=zh4710jj@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.