From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#50904: TODO: Deprecate and remove XPM icons (replacing them with PPM) Date: Wed, 29 Sep 2021 14:47:51 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10667"; mail-complaints-to="usenet@ciao.gmane.io" To: 50904@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 29 23:49:20 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVhS4-0002Tr-8X for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 23:49:20 +0200 Original-Received: from localhost ([::1]:33928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVhS2-00073K-BL for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 17:49:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVhRn-00071m-0N for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 17:49:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVhRm-0000XF-KM for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 17:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVhRm-0008F5-Fy for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 17:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Sep 2021 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50904 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163295208331615 (code B ref -1); Wed, 29 Sep 2021 21:49:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Sep 2021 21:48:03 +0000 Original-Received: from localhost ([127.0.0.1]:50521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVhQp-0008Dq-E3 for submit@debbugs.gnu.org; Wed, 29 Sep 2021 17:48:03 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVhQl-0008DG-MR for submit@debbugs.gnu.org; Wed, 29 Sep 2021 17:48:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVhQl-0005oS-DZ for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 17:47:59 -0400 Original-Received: from mail-pj1-f54.google.com ([209.85.216.54]:44890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVhQg-00082c-5d for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2021 17:47:59 -0400 Original-Received: by mail-pj1-f54.google.com with SMTP id lp15-20020a17090b4a8f00b0019f4059bd90so1595068pjb.3 for ; Wed, 29 Sep 2021 14:47:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=iK9n/0GcggpCJ9zPb0hDts7j3M+194yf+pw19bUGRa4=; b=4CxkevhJn58sWzUU83hSVFFcWZRkxCyUjpNxfOlpsANTTUtS5O1sDXWTqdmEb60EL+ kRoHjGDBQhVnA7nb75PrzIuLJv/KhLwq+TVO8SYeM1bR/xTuY6DcrQNh0p/ZQXqBQ4fN G7DOiG8QIOdOoubSdweqUj25OveXqccEoYjXmCOF7mprwI9FtBavEYc08NdRPthvyEb7 X5vjD/DHL0UnqP25yQpzNAQBZB8uKqpUQLFRfpXmyNEdhDE8VkYfz8S9XIxvORFb2SBZ KaCDt/jZBJ7VCN/dAjBGkswS/9otf69Vgu84UHRvJnYFpPPUSCNx7Toac0GZsJYiB2zC m+UQ== X-Gm-Message-State: AOAM531005raBI4UGZTquLyF6us/FsP4bKblsFmSgtKBwtaWr/VPGG2Y NZl7Qt5XSq1ztm1ueuNfIqDs1DuCY7g1iwwi/yXUj+mS X-Google-Smtp-Source: ABdhPJyOZ1mqxVd1TmAMpOvaE4o9LzEfbHQCfkqURaUTo17LfWwb1y4joNIXwR1r9Dte6FxX9qByFTst1euJ9e0yta0= X-Received: by 2002:a17:90a:5583:: with SMTP id c3mr2255297pji.133.1632952072491; Wed, 29 Sep 2021 14:47:52 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 29 Sep 2021 14:47:51 -0700 Received-SPF: pass client-ip=209.85.216.54; envelope-from=stefankangas@gmail.com; helo=mail-pj1-f54.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:215923 Archived-At: 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