On Thu, May 17, 2012 at 8:05 PM, Bill Spitzak wrote:
> Also this original one:
>
>
> R8 = ( R5 * 527 + 23 ) >> 6;
>
> produces the same results as the floor(i*255/31.0+.5) result.
>
> I believe almost *all* graphics software will do the bit-shifting math and
> thus the (i*33)>>2 result is the one
On Thu, May 17, 2012 at 5:40 PM, Søren Sandmann wrote:
> Søren Sandmann writes:
>
>>> Given a pixel with only the red component of these values, the results
>>> are off-by-one.
>>>
>>> 0x03 -> 0x19 (0x18)
>>> 0x07 -> 0x3A (0x39)
>>> 0x18 -> 0xC5 (0xC6)
>>> 0x1C -> 0xE6 (0xE7)
>>>
>>> (Same for bl
Also this original one:
R8 = ( R5 * 527 + 23 ) >> 6;
produces the same results as the floor(i*255/31.0+.5) result.
I believe almost *all* graphics software will do the bit-shifting math
and thus the (i*33)>>2 result is the one to use.
Bill Spitzak wrote:
Søren Sandmann wrote:
Søren Sand
Søren Sandmann wrote:
Søren Sandmann writes:
Given a pixel with only the red component of these values, the results
are off-by-one.
0x03 -> 0x19 (0x18)
0x07 -> 0x3A (0x39)
0x18 -> 0xC5 (0xC6)
0x1C -> 0xE6 (0xE7)
(Same for blue, and green has many more cases)
It uses
R8 = ( R5 * 527 + 23 )
Søren Sandmann writes:
>> Given a pixel with only the red component of these values, the results
>> are off-by-one.
>>
>> 0x03 -> 0x19 (0x18)
>> 0x07 -> 0x3A (0x39)
>> 0x18 -> 0xC5 (0xC6)
>> 0x1C -> 0xE6 (0xE7)
>>
>> (Same for blue, and green has many more cases)
>>
>> It uses
>> R8 = ( R5 * 527
Matt Turner writes:
> Given a pixel with only the red component of these values, the results
> are off-by-one.
>
> 0x03 -> 0x19 (0x18)
> 0x07 -> 0x3A (0x39)
> 0x18 -> 0xC5 (0xC6)
> 0x1C -> 0xE6 (0xE7)
>
> (Same for blue, and green has many more cases)
>
> It uses
> R8 = ( R5 * 527 + 23 ) >> 6;
>
Given a pixel with only the red component of these values, the results
are off-by-one.
0x03 -> 0x19 (0x18)
0x07 -> 0x3A (0x39)
0x18 -> 0xC5 (0xC6)
0x1C -> 0xE6 (0xE7)
(Same for blue, and green has many more cases)
It uses
R8 = ( R5 * 527 + 23 ) >> 6;
G8 = ( G6 * 259 + 33 ) >> 6;
B8 = ( B5 * 527