From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: PNG image files with alpha channel Date: Fri, 09 May 2008 00:02:29 +0900 Message-ID: <87zlr0yh2y.fsf@catnip.gol.com> References: <87ve1pdnjq.fsf@stupidchicken.com> <4822EC6F.6000703@gnu.org> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210259026 23643 80.91.229.12 (8 May 2008 15:03:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 May 2008 15:03:46 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 08 17:04:18 2008 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 1Ju7ei-0002on-WD for ged-emacs-devel@m.gmane.org; Thu, 08 May 2008 17:03:37 +0200 Original-Received: from localhost ([127.0.0.1]:58999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ju7e1-0001e4-1V for ged-emacs-devel@m.gmane.org; Thu, 08 May 2008 11:02:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ju7dv-0001dk-Lr for emacs-devel@gnu.org; Thu, 08 May 2008 11:02:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ju7du-0001dQ-7V for emacs-devel@gnu.org; Thu, 08 May 2008 11:02:47 -0400 Original-Received: from [199.232.76.173] (port=60448 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ju7du-0001dN-1U for emacs-devel@gnu.org; Thu, 08 May 2008 11:02:46 -0400 Original-Received: from smtp11.dentaku.gol.com ([203.216.5.73]:37102) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ju7dh-0006FL-Jg; Thu, 08 May 2008 11:02:34 -0400 Original-Received: from 203-216-99-062.dsl.gol.ne.jp ([203.216.99.62] helo=catnip.gol.com) by smtp11.dentaku.gol.com with esmtpa (Dentaku) id 1Ju7df-0001nt-8N; Fri, 09 May 2008 00:02:31 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id D99862F4D; Fri, 9 May 2008 00:02:29 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: <4822EC6F.6000703@gnu.org> (Jason Rumney's message of "Thu, 08 May 2008 13:05:03 +0100") Original-Lines: 35 X-Virus-Scanned: ClamAV GOL (outbound) X-Abuse-Complaints: abuse@gol.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:96787 Archived-At: Jason Rumney writes: >> Hmm, I'm not sure what's wrong with this image. For an example of a png >> image with alpha background rendered correctly in Emacs, see >> >> http://www.w3.org/Graphics/PNG/alphatest.png > > Merely loading it into Gimp and saving it seems to be enough to fix the > problem (even with the options "Save background color" and "Save color > values from transparent pixels" ticked). So it must be something in the > details of how Gimp saves transparency info vs the software Miles used. As far as I can tell, it's a valid alpha channel -- firefox displays it "correctly", as do all the image-display programs I've tried. I wrote the software that wrote the image, so I have some handle on what it's doing. It uses libpng to do the actual writing (and reading), which is the same library Emacs uses. Perhaps there's some header info that emacs wants which isn't there? I write the header like: png_set_IHDR (libpng_struct, libpng_info, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_set_gAMA (libpng_struct, libpng_info, gamma_correction); confusing... [My software also reads back the alpha info with no problem.] -Miles -- Egotist, n. A person of low taste, more interested in himself than in me.