code: def load_as_uint8(filename):
      image = gdal.Open(filename)
      image_array = np.array(image.ReadAsArray())
  
      image_uint8 = np.zeros(image_array.shape, dtype=np.uint8)
      # rescale each band to be between 0, 255
  
      for k, band in enumerate(image_array):
          band_max = np.max(band)
  
          if band_max != 0:
              band = band.astype(np.float) / band_max * 255.0
  
          image_uint8[k, :, :] = band
  
      return image_uint8
  
imports: from osgeo import gdal, osr, ogr
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: load_as_uint8(filename) and returns: image_uint8