code: def _image2array(filepath):
      '''
      Utility function that converts an image file in 3 np arrays
      that can be fed into geo_image.GeoImage in order to generate
      a PyTROLL GeoImage object.
      '''
      im = Pimage.open(filepath).convert('RGB')
      (width, height) = im.size
      _r = np.array(list(im.getdata(0)))/255.0
      _g = np.array(list(im.getdata(1)))/255.0
      _b = np.array(list(im.getdata(2)))/255.0
      _r = _r.reshape((height, width))
      _g = _g.reshape((height, width))
      _b = _b.reshape((height, width))
      return _r, _g, _f _image2array(filepath):
      '''
      Utility function that converts an image file in 3 np arrays
      that can be fed into geo_image.GeoImage in order to generate
      a PyTROLL GeoImage object.
      '''
      im = Pimage.open(filepath).convert('RGB')
      (width, height) = im.size
      _r = np.array(list(im.getdata(0)))/255.0
      _g = np.array(list(im.getdata(1)))/255.0
      _b = np.array(list(im.getdata(2)))/255.0
      _r = _r.reshape((height, width))
      _g = _g.reshape((height, width))
      _b = _b.reshape((height, width))
      return _r, _g, _b
docs: Utility function that converts an image file in 3 np arrays
      that can be fed into geo_image.GeoImage in order to generate
      a PyTROLL GeoImage object.