Quiz: Color Reduction 2
1. Oops. I falsely say multiply by 5 when I should say multiply by 51.
2. Someone asked:
"We are dividing up our colors into certain (approximate) ranges: 0 to 43, 43 to 85, 85 to 128, 128 to 171, 171 to 213, and 213 to 255. In the reduction step however, we would round a value of 42 DOWN to 0 and a value of 214 UP to 255. Why not use the middle values of each range?"
That's a good question.
If you divide the range [0...255] into six equal intervals, and then map each to the midpoint, you lose black and white--the darkest you get is 21 and the whitest is 234.
If you want to round to the midpoint and preserve black and white, you want the first and last interval to have half the size of the others:
0 ----][-------][--------][--------][--------][---- 255
Then the formula would be
red = (red + 25) / 256 * 51; ...
Try it out and see if you like the result better.