From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: [sdl.web@gmail.com: Re: problem with transparent PNG image display] Date: Wed, 01 Aug 2007 10:30:38 -0400 Message-ID: References: <46A527C9.7040401@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1185978550 25733 80.91.229.12 (1 Aug 2007 14:29:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2007 14:29:10 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 01 16:29:04 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 1IGFCA-00087B-Mf for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2007 16:29:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IGFCA-0005VM-8T for ged-emacs-devel@m.gmane.org; Wed, 01 Aug 2007 10:29:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IGFBU-00056j-Rs for emacs-devel@gnu.org; Wed, 01 Aug 2007 10:28:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IGFBT-00055h-BW for emacs-devel@gnu.org; Wed, 01 Aug 2007 10:28:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IGFBT-00055a-0n for emacs-devel@gnu.org; Wed, 01 Aug 2007 10:28:19 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IGFBS-0001wG-OO for emacs-devel@gnu.org; Wed, 01 Aug 2007 10:28:18 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IGFDi-0005Ls-O9; Wed, 01 Aug 2007 10:30:38 -0400 In-Reply-To: <46A527C9.7040401@gnu.org> (message from Jason Rumney on Mon, 23 Jul 2007 23:12:25 +0100) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:75904 Archived-At: [I sent this message a week ago but did not get a response. Could we get the discussion moving again?] When no background color is saved in the image, we render using the background color of the face the image is first drawn with, so the problem is not immediately apparent with those images, but if you draw the same image object onto a different colored background, you will see the same problem occur. The cache could record what background color was used for rendering. Then, on displaying the image again, if the desired background is different, that could cause a cache-mismatch, which would cause re-rendering. For efficiency, we should do that only for formats that allow transparency. Is it possible to tell easily whether a png image has any transparency? Then we could optimize the images that don't have any transparency by not recording a background for it. I don't know which platforms will let us cache image objects with transparency, but the solution would be to do that, and draw the background separately each time the image is drawn. There must be something I don't get. What would stop us from caching the actual image data, transparent or not? Is the idea that we want to save the time to re-render the image?