code: def normalize_to_uint8(
      x: Union[np.ndarray, JaxArray]
  ) -> Union[np.ndarray, JaxArray]:
      """Map a float image in [1/256-1, 1-1/256] to uint8 {0, 1, ..., 255}."""
      return (
          (128 * (x + (1 - 1 / 256)))
          .clip(0, 255)
          .round()
          .astype("uint8")
      )
  
file_path: objax/objax/util/image.py
imports: import io
  from typing import Union, BinaryIO, IO
  import jax.numpy
  import numpy
  from PIL import Image
  from objax.typing import JaxArray
label_desc: Use image node_id 5 for calling a global function with example usage: normalize_to_uint8(x) and returns: unknown