[cairo] RFC: More accurate color conversion

Søren Sandmann sandmann at cs.au.dk
Sat Oct 5 18:38:43 PDT 2013

Wolfgang Draxinger <wdraxinger.maillist at draxit.de> writes:

> I'd like to throw in this little paper, discussing the problem of
> floating point <-> integer range conversion at depth: 
> http://kaba.hilvi.org/homepage/programming/range/RangeConversion.pdf

In terms of that paper, f(x) is fixed to be x / 65535.0, and so the rest
of the paper doesn't really apply since it's trying to find a _pair_ of
functions f and g such that the error between f(g(x)) and x is
minimized [1].

With f(x) = x / 65535.0, I believe the function g that minimizes that
error is the midtread quantizer, AKA plain old rounding.


[1] In the Acknowledgements section, the paper talks about minimizing
the error between x and g(f(x)), but presumably that's a typo since
hopefully x == g(f(x)) for all x.

More information about the cairo mailing list