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: PNG image files with alpha channel Date: Thu, 08 May 2008 14:19:56 -0400 Message-ID: <87od7gu08j.fsf@stupidchicken.com> References: <87ve1pdnjq.fsf@stupidchicken.com> <4822EC6F.6000703@gnu.org> <87zlr0yh2y.fsf@catnip.gol.com> <482319D6.1020308@gnu.org> <87tzh8yfdc.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210271131 4780 80.91.229.12 (8 May 2008 18:25:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 May 2008 18:25:31 +0000 (UTC) Cc: emacs-devel@gnu.org, Jason Rumney To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 08 20:26:06 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 1JuAoP-00069G-W3 for ged-emacs-devel@m.gmane.org; Thu, 08 May 2008 20:25:50 +0200 Original-Received: from localhost ([127.0.0.1]:43426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JuAnh-0006MX-Nx for ged-emacs-devel@m.gmane.org; Thu, 08 May 2008 14:25:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JuAnc-0006Lj-QF for emacs-devel@gnu.org; Thu, 08 May 2008 14:25:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JuAnY-0006JK-77 for emacs-devel@gnu.org; Thu, 08 May 2008 14:25:00 -0400 Original-Received: from [199.232.76.173] (port=45779 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JuAnY-0006JD-1g for emacs-devel@gnu.org; Thu, 08 May 2008 14:24:56 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:34733) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JuAnL-0004tU-VT; Thu, 08 May 2008 14:24:44 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id A7D5C4E585; Thu, 8 May 2008 14:19:56 -0400 (EDT) In-Reply-To: <87tzh8yfdc.fsf@catnip.gol.com> (Miles Bader's message of "Fri, 09 May 2008 00:39:27 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:96809 Archived-At: Miles Bader writes: > Upon looking closer, I see on very odd attribute: while the original > image I wrote was RGBA, 8-bits per channel, the decimated versions > written by imagemagick are RGBA, 16-bits per channel... The Emacs > PNG-reading code asks libpng to convert 16-bit-per-channel images to > 8-bits per channel, but as such images are fairly rare, it may be that > libpng doesn't do it correctly. > > If I open the original RGBA 8-bits per channel image with Emacs, indeed, > it handles the alpha-channel correctly. > > I did step through the code, BTW, and as far as I can tell, Emacs is > doing the correct things. > > So the problem may in fact be something with the libpng 16-to-8-bit > conversion code... One possibility is that libpng's png_set_strip_16 function only strips the RGB channels down to 8 bits, while keeping the alpha channel at 16 bits.