Converting Byte Intensities to a Unit Range

An unsigned eight-bit image sample can be mapped from 0 through 255 to a normalized 0 through 1 range by dividing by 255.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace one value
  2. Check the direction and quantization

Trace one value

Value 128 maps to roughly 0.502. Zero and 255 become the two endpoints. Unsigned field width explains the source range.

Check the direction and quantization

Converting a normalized value back needs a rounding and range rule. A floating value of one half lies between two of the original codes. See rounding choices.[1][2]

References

  1. scikit-image Contributors, NumPy Images and Coordinate Conventions ↩
  2. scikit-image Contributors, Image Data Types and Representable Values ↩