From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: [dooglus@gmail.com: problem with transparent PNG image display] Date: Wed, 17 Jan 2007 23:24:04 -0500 Message-ID: <87ps9drmhn.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1169094302 4699 80.91.229.12 (18 Jan 2007 04:25:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2007 04:25:02 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 18 05:24:59 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7Ope-0002NW-Op for ged-emacs-devel@m.gmane.org; Thu, 18 Jan 2007 05:24:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7Opf-0005VC-Av for ged-emacs-devel@m.gmane.org; Wed, 17 Jan 2007 23:24:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7OpU-0005V7-3o for emacs-devel@gnu.org; Wed, 17 Jan 2007 23:24:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7OpT-0005Uv-DA for emacs-devel@gnu.org; Wed, 17 Jan 2007 23:24:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7OpT-0005Us-AE for emacs-devel@gnu.org; Wed, 17 Jan 2007 23:24:47 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H7OpS-0003z2-Sw for emacs-devel@gnu.org; Wed, 17 Jan 2007 23:24:47 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H7Op9-0004ud-EV for emacs-devel@gnu.org; Thu, 18 Jan 2007 05:24:28 +0100 Original-Received: from sydneypacific-four-ninety-eight.mit.edu ([18.95.6.243]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Jan 2007 05:24:27 +0100 Original-Received: from cyd by sydneypacific-four-ninety-eight.mit.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 18 Jan 2007 05:24:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 41 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: sydneypacific-four-ninety-eight.mit.edu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) Cancel-Lock: sha1:Ne4NWDLwdJ+9VyaQ409lq7Lh1kc= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65266 Archived-At: > From: Chris Moore > > Download this image and open it in Emacs: > > http://tango-project.org/static/cvs/tango-art-tools/palettes/Tango-Palette.png > > The image has lots of transparent pixels. Using M-x > set-background-colour RET and you'll see the background of the image > changes with the background. Umm, no it doesn't (check again). Emacs 22 does not support dynamically changing background colors, because that would involve loading a new image object, and no one has gotten around to writing the necessary code. See image.c:6375. Png images can specify what color to draw the background in if a browser cannot handle arbitrary transparencies (this is the "Save background color" option in Gimp). The png code in Emacs fills in the image background with the current frame background iff this background color is unspecified. This is why the `convert'ed png shows a white background in Emacs, whereas the original png used whatever background color your frame had---because imagemagick defaults to a white background, whereas the original png did not specify it. Again, note that using M-x set-background-color RET will NOT change the background color of the displayed image. I think this bug should be removed from FOR-RELEASE. Someone should, however, work on this after the release. > Now use 'convert' from ImageMagick to make a copy of the image: > > $ convert Tango-Palette.png Tango-Palette-copy.png > > Open the new copy in Emacs and the transparent pixels show up as white > pixels. Open the copy in The GIMP or gqview and you can see that the > background really is still transparent. > > I'm using this version of convert: > > Version: ImageMagick 6.2.4 12/13/06 Q16 http://www.imagemagick.org > Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC