code: def image_to_uint8(image: np.ndarray) -> np.ndarray:
      """Convert the image to a uint8 array."""
      if image.dtype == np.uint8:
          return image
      if not issubclass(image.dtype.type, np.floating):
          raise ValueError(
              f"Input image should be a floating type but is of type {image.dtype!r}"
          )
      return (image * UINT8_MAX).clip(0.0, UINT8_MAX).astype(np.uint8)
  
imports: import math
  from typing import Tuple
  from absl import logging
  import cv2
  import imageio
  import numpy
  from PIL import Image
  from nerfies import gpath
  from nerfies import types
label_desc: Use image node_id 7 for calling a global function with example usage: image_to_uint8(image) and returns: unknown, image