frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Should you normalize RGB values by 255 or 256?

https://30fps.net/pages/255-vs-256-division/
42•pplanu•1h ago

Comments

DigitallyFidget•36m ago
255 gives 0-255, which gives you a zero value. 256 is 1-256, you lose the option of setting 0.
crazygringo•4m ago
That's not what the article is about.
dudu24•35m ago
If you have a ruler and it goes to 12 inches, you should normalize by the length L and not by 13, the number of points on the ruler.
lacedeconstruct•21m ago
yes but >> 8 is so much faster
groundzeros2015•20m ago
I’m dumb. Doesn’t 0 start at the beginning?
herf•27m ago
I'll argue for the +0.5 solution. First, I don't like half-sized intervals at the edges, and second, a 255-based representation is typically a SDR (not HDR) image.

RGB values represent luminances against some adapted state, and a "zero" in a daylit scene is not "zero luminance" - it's just about 0.001x as bright as the brightest point - it's millions of photons, way more than zero. In a sense our eyes experience contrast on a sliding scale, and there is no absolute zero in the system. For example, broadcast systems historically used 16-235 as their luminance range for SDR. I think any argument that says "we must have zero" is going to have a bias, but I don't think zero is needed for most things.

yxhuvud•17m ago
Both solutions add 0.5, the difference is where in the process it happens.
theyeenzbeanz•26m ago
Should always be 0-255 as that fits an unsigned byte.
Retr0id•8m ago
> assume that in both cases the output values are clamped before the final typecast
crazygringo•5m ago
That's not what the article is about.
Retr0id•12m ago
Both of these assume a linear transfer function, which is rarely the case.
crazygringo•10m ago
Advice for anyone on mobile: read in landscape mode if you want to be able to see the division by 256 version code example at the start.

The HTML/CSS is bad that lets it completely overflow the right edge of the page instead of wrapping.

I re-read this post three times in total confusion before I figured out the most important piece was off-screen entirely.

The newest Instagram “exploit” is the goofiest I've seen

https://www.0xsid.com/blog/meta-account-takeover-fiasco
659•ssiddharth•3h ago•168 comments

GitHub and the Crime Against Software

https://eblog.fly.dev/githubbad.html
32•pplanu•37m ago•1 comments

AI Agent Guidelines for CS336 at Stanford

https://github.com/stanford-cs336/assignment1-basics/blob/main/CLAUDE.md
155•prakashqwerty•2h ago•76 comments

Lifelike biochemistry continued to unfold in sterilized soil

https://www.quantamagazine.org/the-dirt-that-refused-to-die-20260601/
130•speckx•4h ago•31 comments

Should you normalize RGB values by 255 or 256?

https://30fps.net/pages/255-vs-256-division/
45•pplanu•1h ago•12 comments

CS336: Language Modeling from Scratch

https://cs336.stanford.edu/
221•kristianpaul•5h ago•31 comments

Ask HN: Who is hiring? (June 2026)

95•whoishiring•4h ago•131 comments

I made my phone slow on purpose

https://vinewallapp.com/notes/i-made-my-phone-slow-on-purpose/
105•gcampos•4d ago•97 comments

A 10 year old Xeon is all you need

https://point.free/blog/gemma-4-on-a-2016-xeon/
593•cafkafk•12h ago•248 comments

Ask HN: Who wants to be hired? (June 2026)

48•whoishiring•4h ago•152 comments

Windows GOG DOS Games on M-Series Macs

https://f055.net/technology/windows-gog-dos-games-on-m-series-macs/
103•f055•6h ago•59 comments

Malicious npm packages detected across Red Hat Cloud Services

https://github.com/RedHatInsights/javascript-clients/issues/492
673•kurmiashish•6h ago•360 comments

Flipper Zero Zig Template

https://github.com/NishantJoshi00/flipper-template
99•Nars088•6h ago•5 comments

Stealing from Biologists to Compile Haskell Faster

https://www.iankduncan.com/engineering/2026-05-30-stealing-from-biologists-to-compile-haskell-fas...
26•mooreds•2d ago•2 comments

The Pirate Bay Remains Resilient, 20 Years After the Raid

https://torrentfreak.com/the-pirate-bay-remains-resilient-20-years-after-the-raid/
363•speckx•5h ago•165 comments

Only 17% of all 64-bit Integers are products of two 32-bit integers

https://lemire.me/blog/2026/05/22/only-17-of-all-64-bit-integers-are-products-of-two-32-bit-integ...
149•sebg•4d ago•73 comments

Launch HN: Expanse (YC P26) – Unlock Wasted GPU Capacity

54•ismaeel_bashir•6h ago•11 comments

Sysadmining Like It's 2009

https://lambdacreate.com/posts/sysadmining-like-its-2009
64•yacin•5h ago•20 comments

Mumbai's famed dabbawalas fed millions for over 100 years

https://www.bbc.co.uk/news/articles/c202d0l92weo
6•frou_dh•1d ago•5 comments

Nvidia RTX Spark

https://www.nvidia.com/en-us/products/rtx-spark/
191•shenli3514•14h ago•154 comments

Handmade Hawaiian Islands Map

https://www.notesfromtheroad.com/roam/hawaiian-islands-map.html
23•bovermyer•2d ago•9 comments

Radxa Dragon Q8B: A Laptop Cosplaying as an SBC?

https://bret.dk/radxa-dragon-q8b-a-laptop-cosplaying-as-an-sbc/
40•gainsurier•5h ago•32 comments

Surface Laptop Ultra

https://blogs.windows.com/devices/2026/05/31/introducing-surface-laptop-ultra-made-for-world-makers/
82•berlianta•14h ago•124 comments

Show HN: A CSS 3D Engine (no WebGL)

https://github.com/LayoutitStudio/polycss
40•rofko•5h ago•17 comments

Linux Basics for Hackers (2019)

https://github.com/ahegazy0/linux-basics-for-hackers-notes
80•ibobev•6h ago•16 comments

Anthropic confidentially submits draft S-1 to the SEC

https://www.anthropic.com/news/confidential-draft-s1-sec
286•surprisetalk•3h ago•195 comments

Tracing HTTP Requests with Go's net/HTTP/httptrace

https://blainsmith.com/articles/httptrace-with-go/
154•speckx•4d ago•9 comments

"The Apple Boogie" 1987 Mac Promo Album Cassette Tape [video]

https://www.youtube.com/watch?v=chJHB-btMNI
36•1970-01-01•2d ago•9 comments

Superintelligence: The Idea That Eats Smart People (2016)

https://idlewords.com/talks/superintelligence.htm
58•thoughtpeddler•1h ago•50 comments

KDE at 30

https://kde.org/anniversaries/30/
190•Kye•5h ago•90 comments