Open graphitemaster opened 9 years ago
Please attach an input file on which this code causes invalid output to be generated.
Both your change suggestions cause incorrect encoding of all-white blocks (#ffffff, causing r=31, g=63, b=31) as all-black.
Furthermore, the AND should actually in all practically relevant cases be the identity operation, and only serves to fulfill the output requirements; this is also why this code merely does AND and no clamping. If you can provide any input where this is relevant, I will check whether the calling code is wrong (and uses the color data wrong), or whether we really need clamping here.
Thanks!
graphitemaster , any updates here?
The following is incorrect
This should be made into
Or the following which isn't correct either as 31 and 63 are not powers of two, but probably what was intended when it was written.