Should you normalize RGB values by 255 or 256?

·Hacker News··

30fps.net — Computer Graphics & Programming with Pekka Väänänen Should you normalize RGB values by 255 or 256? June 1st, 2026 Let’s say you’re writing an image processing program. The program takes in an image, converts it to floating point, does some processing and finally saves the modified pixels to disk as 8-bit colors. The question today concerns how exactly the integer-to-float conversion should be done. There are two approaches which, written in Python and NumPy, look like this: Standard

Read full article →

Related Articles

New HIV vaccine shows unprecedented success in preclinical study
codebyaditya · Hacker News · 8h ago
A walk through of the DeltaNet family of linear attention variants
AnhTho_FR · Hacker News · 5h ago
Zig's Incremental Compilation Internals
garyhtou · Hacker News · 5h ago
US citizen charged after GrapheneOS phone wipes during airport search
eecc · Hacker News · 1d ago
GrapheneOS Defends Data-Wiping Function That Blocked US Border Search
pseudolus · Hacker News · 6h ago