unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM)
@ 2021-09-29 21:47 Stefan Kangas
  2021-09-30  6:55 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2021-09-29 21:47 UTC (permalink / raw)
  To: 50904

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM)
  2021-09-29 21:47 bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM) Stefan Kangas
@ 2021-09-30  6:55 ` Lars Ingebrigtsen
  2021-09-30  9:28   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-30  6:55 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 50904

Stefan Kangas <stefan@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM)
  2021-09-30  6:55 ` Lars Ingebrigtsen
@ 2021-09-30  9:28   ` Eli Zaretskii
  2021-10-01 11:08     ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2021-09-30  9:28 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: stefan, 50904

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Thu, 30 Sep 2021 08:55:39 +0200
> Cc: 50904@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM)
  2021-09-30  9:28   ` Eli Zaretskii
@ 2021-10-01 11:08     ` Stefan Kangas
  2021-10-01 11:17       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2021-10-01 11:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 50904-done, Lars Ingebrigtsen

Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM)
  2021-10-01 11:08     ` Stefan Kangas
@ 2021-10-01 11:17       ` Eli Zaretskii
  2021-10-01 11:30         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2021-10-01 11:17 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 50904-done, larsi

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 1 Oct 2021 13:08:42 +0200
> Cc: Lars Ingebrigtsen <larsi@gnus.org>, 50904-done@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM)
  2021-10-01 11:17       ` Eli Zaretskii
@ 2021-10-01 11:30         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-01 11:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 50904-done, Stefan Kangas

Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-01 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 21:47 bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM) Stefan Kangas
2021-09-30  6:55 ` Lars Ingebrigtsen
2021-09-30  9:28   ` Eli Zaretskii
2021-10-01 11:08     ` Stefan Kangas
2021-10-01 11:17       ` Eli Zaretskii
2021-10-01 11:30         ` Lars Ingebrigtsen

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).