unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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?





  reply	other threads:[~2023-12-24 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACph+bW99OiFn2c_yWy_vE3nw90ZLwmPES-uCuu=JYdQtHhubQ@mail.gmail.com>
2023-12-22 11:38 ` bug#67968: [PATCH] A small patch to make emacs support transparent image (png, webp, svg) Qiutum
2023-12-24 14:36   ` Stefan Kangas [this message]
2024-03-10 20:50   ` nsan

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

  List information: https://www.gnu.org/software/emacs/

* 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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).