From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Several suggestions for image support Date: Fri, 16 Apr 2004 18:29:05 +0900 Organization: Faculty of Science, Chiba University Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1082107892 29523 80.91.224.253 (16 Apr 2004 09:31:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Apr 2004 09:31:32 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Apr 16 11:31:24 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BEPgy-0007ol-00 for ; Fri, 16 Apr 2004 11:31:24 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BEPgx-0002hf-00 for ; Fri, 16 Apr 2004 11:31:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BEPfP-0000uE-Fz for emacs-devel@quimby.gnus.org; Fri, 16 Apr 2004 05:29:47 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BEPfJ-0000te-C9 for emacs-devel@gnu.org; Fri, 16 Apr 2004 05:29:41 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BEPel-0000h3-2G for emacs-devel@gnu.org; Fri, 16 Apr 2004 05:29:38 -0400 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BEPek-0000gz-6D for emacs-devel@gnu.org; Fri, 16 Apr 2004 05:29:06 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 21DD61A63A4 for ; Fri, 16 Apr 2004 18:29:05 +0900 (JST) Original-To: emacs-devel@gnu.org In-Reply-To: User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21740 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21740 >>>>> On 16 Apr 2004 02:21:11 +0200, David Kastrup said: > PNG images support transparency. Emacs can't make use of it. You > can only have Emacs declare a particular color as transparent. This > is dissatisfactory. It should tell the PNG decoding routines Emacs' > background color for the purpose of transparency. As for PNG transparency, there was one thing that I noticed (and I've been forgotten to tell about it) while I was porting image support to Carbon Emacs. In png_load (image.c): user_bg.red = color.red >> PNG_BG_COLOR_SHIFT; user_bg.green = color.green >> PNG_BG_COLOR_SHIFT; user_bg.blue = color.blue >> PNG_BG_COLOR_SHIFT; fn_png_set_background (png_ptr, &user_bg, PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); I think the background color should be specified in 8-bit depth here (thus PNG_BG_COLOR_SHIFT should be 8 for all the platforms) because the 4th argument (aka need_expand) for fn_png_set_background is 0 and the image data has been normalized in 8-bit depth at this stage. You can observe the difference using http://www.w3.org/Graphics/PNG/alphatest.png. The same thing is also applied to the other place (in png_load) where fn_png_set_background is called with its 4th argument 0. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp