A deep dive into whether RGB integer values should be normalized by dividing by 255 or 256 when converting to floating point for image processing. The standard approach (÷255) maps 0→0.0 and 255→1.0, matching GPU conventions, but results in half-width bins at the extremes and inexact floating-point values. The alternative (÷256 with 0.5 bias) is a mid-tread quantizer that places values exactly at bin midpoints and offers marginally lower reconstruction error. The analysis frames both as uniform scalar quantizers (mid-riser vs mid-tread), concludes that for processing third-party images the standard ÷255 is correct, and that ÷256 only makes sense when you control both encoding and decoding. Mixing the two approaches is always wrong.

9m read timeFrom 30fps.net
Post cover image
Table of contents
The case against 255.0Two types of quantizersConclusionOther takes
254 Impressions