all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: PNG pictures have gamma correction twice applied
Date: Mon, 11 Nov 2002 11:58:13 -0500	[thread overview]
Message-ID: <200211111658.gABGwDC16585@rum.cs.yale.edu> (raw)
In-Reply-To: x54raqicz0.fsf@lola.goethe.zz

> Now x_alloc_nearest_color is defined in src/xterm.c.  It first calls
> gamma_correct on the function in question (which does the gamma
> correction with a very expensive floating point operation), then
> calls x_alloc_nearest_color_1, which does a costly operation of
> figuring out a closest color.

Have you checked whether this "costly operation" is actually done
in your case ?  It should only happen if the XAllocColor fails, which
should never be the case in a 16bpp (or more) display.

> entirely bypassed the whole folderol, and I would guess that for the
> rest 10% of users with 8bit per pixel devices, some low quality
> fallback (such as getting 64 fixed colors for 8bit display devices)
> would still be appreciated more than the current slow behavior of
> images.

The reason for the "closest color" code is to deal with the situation
where the aren't enough color slots available.  There might very well
not be 64 slots available.
I think this part of the code is OK, especially since I believe it is only
triggered in the very rare cases where it is needed.

But I agree that the lookup&gamma&caching is a bit strangely done and
is probably not ideal for displays with more than 256 colors.  I believe
the code for lookup has a comment that says essentially the same thing.

But I also remember that some of that code was done to try and reduce the
amount of X traffic (there were many calls to XAllocColor or XLookupColor
or something like that).
I think the caching could be improved (to reduce X traffic), tho.
And bypassing this code for PNG would be a good idea since libpng should
do a good enough (better) job already.


	Stefan

  parent reply	other threads:[~2002-11-11 16:58 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=200211111658.gABGwDC16585@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.