unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: PNG pictures have gamma correction twice applied
Date: Mon, 11 Nov 2002 05:20:08 -0500	[thread overview]
Message-ID: <E18BBfs-0002H9-00@fencepost.gnu.org> (raw)
In-Reply-To: <x54raqicz0.fsf@lola.goethe.zz> (David.Kastrup@t-online.de)

Would you like to rewrite the png code thoroughly?

      This table is used as
    some sort of a cache, in addition, and this cache is apparently not
    cleared or reused consistently when the gamma correction factor of
    the frame (gamma correction is a frame-local property) changes:

If the lookup cannot be avoided completely, the caching may be worth
while as an optimization.  I am not saying that it is, since I have
not studied the code, just that this is something you should consider.

      The size of the hash table is 101
    entries, so if things like JPEG images are displayed, easily 100000
    different colors can be achieved, and thus a single hash bucket might
    contain thousands of pixels.

There needs to be a way to reallocate this hash table in case it gets
too full.

    It would appear to me that the pictures should be made to bypass this
    lookup mechanism entirely:

If that is possible, it would sure be better.

    All this is very much over the top where images are concerned: an
    operation far too costly to do for every pixel anew.

If only the png library does its own gamma correction, it would seem
Emacs should still do gamma correction for images itself.  But perhaps
it can do that in a more efficient way.

    nowadays), the whole pixel lookup and color allocation business is
    utterly unnecessary, anyway, since one can directly map requested
    color to available color

We could keep the ability to do the lookup but use it only on
devices where it is needed.

Anyway, please do clean up this mess.

  reply	other threads:[~2002-11-11 10:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200211061556.gA6FuCU6005082@localhost.localdomain>
2002-11-07 15:08 ` PNG pictures have gamma correction twice applied Richard Stallman
2002-11-09 22:40   ` David Kastrup
2002-11-11 10:20     ` Richard Stallman [this message]
2002-11-30 13:36       ` David Kastrup
2002-12-03 14:59         ` Richard Stallman
2002-12-03 15:21           ` David Kastrup
2002-12-05 15:08             ` Richard Stallman
2002-12-05 15:34               ` David Kastrup
2002-12-05 17:31               ` David Kastrup
2002-12-06 15:52                 ` Richard Stallman
2002-12-06 16:01                   ` David Kastrup
2002-11-11 16:58     ` Stefan Monnier
2002-11-11 17:30       ` David Kastrup
2002-11-11 17:43         ` Stefan Monnier
2002-11-18 11:31           ` David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E18BBfs-0002H9-00@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).