[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PNG pictures have gamma correction twice applied
From: |
Richard Stallman |
Subject: |
Re: PNG pictures have gamma correction twice applied |
Date: |
Mon, 11 Nov 2002 05:20:08 -0500 |
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.