Should you normalize RGB values by 255 or 256?
12 points by LesleyLai
12 points by LesleyLai
It looks dirty, but yeah, it's 255. If this is unintuitive you can force the intuition by looking at the degenerate 2-bit case where the only integer values are 0, 1, 2, and 3, and then brute force the corresponding int->float conversion values. If you don't want extremely obviously wonky behavior like obviously-uneven, or black or white not being black or white, you end up with 0.0, 0.33..., 0.66..., and 1.0. And then the inversion of that involves multiplying by 3, not 4 (2^2).