Re: [cairo] RFC: More accurate color conversion

James Cloos <cloos-GRsvFm/Gh/[email protected]>
Newsgroups gmane.comp.graphics.pixman,gmane.comp.lib.cairo
Message-ID <[email protected]>
>>>>> "SS" == Søren Sandmann <[email protected]> writes:

SS> There are two functions being talked about here:

Of course.

SS>       f: uint16_t -> double
SS> and
SS>       g: double -> uint16_t

SS> When you say "multiply (with saturation) by IMAX+1 and divide by IMAX"
SS> I assume you mean

SS>        f(i) = i / 65535.0
SS> and 
SS>        g(x) = MAX (x * 65536, 65535.0)

The latter of course should be MAX(0.,MAX(x*65536.,65535.)).

Saturation works both ways. ;^)

SS> which is indeed what cairo does now.

As I write.

SS> I think everyone agrees that
SS>       f(i) = i / 65535.0
SS> is the right choice for f,

At the time there were some who did not.  I'm glad that is in the past.

SS> but for g, I am proposing a different formula.

I noticed.

SS> that as argued elsewhere has less error.

I didn't add an argument for the status quo because my post in this
thread was more of a devil's advocate and I wanted to think about it
some more.

Equal-size-intervals is of course why I concluded as I did back then.

Your argument is interesting.  

-JimC
-- 
James Cloos <cloos-GRsvFm/Gh/[email protected]>         OpenPGP: 1024D/ED7DAEA6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.