News for hackers. Stuff that matters.
Re:Should you normalize RGB values by 255 or 256? by yxhuvud on Monday June 01, 2026 @03:14PM (#48361297)
Both solutions add 0.5, the difference is where in the process it happens.
Re:Should you normalize RGB values by 255 or 256? by account42 on Tuesday June 02, 2026 @06:39AM (#48368413)
They don't - trunc(result * 255 + 0.5) is just round(result * 255), i.e. error is on average 0 whereas trunc(result * 256) has an average bias of -0.5.