Should you normalize RGB values by 255 or 256? | Hacker News
TL;DR AI
2 min readKey summary
Hacker News commenters debated whether RGB bytes should be normalized by 255 or 256 when converting to floating point.
Supporters of 255 argued it is mathematically correct for mapping uint8 values into the full 0–1 range.
Others favored 256-style approximations or bit-shift tricks for speed, especially in renderers and other performance-sensitive code.
The thread also touched on dithering, alpha blending, and how the same scaling tradeoff appears in audio sample conversion.



