GNU bug report logs - #50904
TODO: Deprecate and remove XPM icons (replacing them with PPM)

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Wed, 29 Sep 2021 21:49:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50904 in the body.
You can then email your comments to 50904 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50904; Package emacs. (Wed, 29 Sep 2021 21:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 29 Sep 2021 21:49:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: TODO: Deprecate and remove XPM icons (replacing them with PPM)
Date: Wed, 29 Sep 2021 14:47:51 -0700
Severity: wishlist

In etc/TODO we have the following item:

    ** Deprecate and remove XPM icons
    Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap
    the XPMs so that the color versions work generally.  (Requires care
    with the color used for the transparent regions.)

Here's what I've gathered so far, posting it here to save someone else
the trouble:

PPM (Portable PixelMap) is the color version of PBM (Portable BitMap)
and has as good support.[1]  XPM is an older format.

There are previous discussions on emacs-devel, but I have only been able
to track some of them down.  The TODO itself dates back to February 2003
(bf6394a6bed2).

I have tried to convert the images with netpbm using this:

    cd etc/images
    xpmtoppm --alphaout=attach.alpha attach.xpm | \
          pnmcomp -alpha=attach.alpha - > attach.ppm
    pnmcomp: bad magic number 0x0 - not a PAM, PPM, PGM, or PBM file

But then I don't get any further.

I have also tried with the newer pamcomp (that replaces pnmcomp):

    cd etc/images
    xpmtoppm --alphaout=attach.alpha attach.xpm | \
             pamcomp attach.alpha - atach.ppm

That just leads to an image that looks wrong.

With GraphicsMagick, I used "gc convert attach.xpm attach.ppm" but the
results looked all wrong.

With GIMP it seems like I can produce images that preserve the alpha
channels correctly, but perhaps not in all cases.  It also seems like
different files produce different results, maybe?  But on balance,
perhaps a combination of GIMP and GraphicsMagick would be best.

---

Be aware that Debian has an old forked version of netpbm from 2002, so
if you want to use xpmtoppm, you need to install netpbm from
SourceForge.  Luckily, there are .deb packages available (as well as
source tarballs).

Footnotes:
[1]  https://lists.gnu.org/r/emacs-devel/2002-09/msg00949.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50904; Package emacs. (Thu, 30 Sep 2021 06:56:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50904 <at> debbugs.gnu.org
Subject: Re: bug#50904: TODO: Deprecate and remove XPM icons (replacing them
 with PPM)
Date: Thu, 30 Sep 2021 08:55:39 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> In etc/TODO we have the following item:
>
>     ** Deprecate and remove XPM icons
>     Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap
>     the XPMs so that the color versions work generally.  (Requires care
>     with the color used for the transparent regions.)

There doesn't seem to be any bug reports about XPM colours not working
correctly -- what are the symptoms?

XPMs are attractive in that they allow addressing colours by name, and
you can therefore alter them on-the-fly without editing the images.
(See `gnus-logo-color-alist' for something that exploits this.)  You can
do the same with SVG images, but then you need SVG support.  And you
can't do this with PPMs, I think.

So I'm not sure I agree with that TODO item, unless I'm missing
something (which I may well be).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50904; Package emacs. (Thu, 30 Sep 2021 09:29:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: stefan <at> marxist.se, 50904 <at> debbugs.gnu.org
Subject: Re: bug#50904: TODO: Deprecate and remove XPM icons (replacing them
 with PPM)
Date: Thu, 30 Sep 2021 12:28:26 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Thu, 30 Sep 2021 08:55:39 +0200
> Cc: 50904 <at> debbugs.gnu.org
> 
> There doesn't seem to be any bug reports about XPM colours not working
> correctly -- what are the symptoms?
> 
> XPMs are attractive in that they allow addressing colours by name, and
> you can therefore alter them on-the-fly without editing the images.
> (See `gnus-logo-color-alist' for something that exploits this.)  You can
> do the same with SVG images, but then you need SVG support.  And you
> can't do this with PPMs, I think.
> 
> So I'm not sure I agree with that TODO item, unless I'm missing
> something (which I may well be).

I agree.  It sounds like this item is outdated, and we should delete
it.




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Fri, 01 Oct 2021 11:09:01 GMT) Full text and rfc822 format available.

Notification sent to Stefan Kangas <stefan <at> marxist.se>:
bug acknowledged by developer. (Fri, 01 Oct 2021 11:09:01 GMT) Full text and rfc822 format available.

Message #16 received at 50904-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50904-done <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#50904: TODO: Deprecate and remove XPM icons (replacing them
 with PPM)
Date: Fri, 1 Oct 2021 13:08:42 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> > So I'm not sure I agree with that TODO item, unless I'm missing
> > something (which I may well be).
>
> I agree.  It sounds like this item is outdated, and we should delete
> it.

Ugh, I wasted over 2 hours on this...

I've now removed this from etc/TODO (commit f733b909ff), and I'm
closing this bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50904; Package emacs. (Fri, 01 Oct 2021 11:18:01 GMT) Full text and rfc822 format available.

Message #19 received at 50904-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 50904-done <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#50904: TODO: Deprecate and remove XPM icons (replacing them
 with PPM)
Date: Fri, 01 Oct 2021 14:17:29 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Fri, 1 Oct 2021 13:08:42 +0200
> Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 50904-done <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > > So I'm not sure I agree with that TODO item, unless I'm missing
> > > something (which I may well be).
> >
> > I agree.  It sounds like this item is outdated, and we should delete
> > it.
> 
> Ugh, I wasted over 2 hours on this...

Sorry about that, and thanks for taking care of those forgotten items.

> I've now removed this from etc/TODO (commit f733b909ff), and I'm
> closing this bug.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50904; Package emacs. (Fri, 01 Oct 2021 11:32:02 GMT) Full text and rfc822 format available.

Message #22 received at 50904-done <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 50904-done <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#50904: TODO: Deprecate and remove XPM icons (replacing them
 with PPM)
Date: Fri, 01 Oct 2021 13:30:56 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Ugh, I wasted over 2 hours on this...
>
> Sorry about that, and thanks for taking care of those forgotten items.

Yup; it's very much appreciated.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 Oct 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 172 days ago.

Previous Next


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