Save an image, represented as an ndarray, to the filesystem
  :param path: string, filepath
  :param ndarray: The image as an ndarray
  :param min_val: The minimum pixel value in the image format
  :param max_val: The maximum pixel valie in the image format
    If min_val and max_val are not specified, attempts to
    infer whether the image is in any of the common ranges:
      [0, 1], [-1, 1], [0, 255]
    This can be ambiguous, so it is better to specify if known.

def save(path, ndarray, min_val=None, max_val=None):
  """
  Save an image, represented as an ndarray, to the filesystem
  :param path: string, filepath
  :param ndarray: The image as an ndarray
  :param min_val: The minimum pixel value in the image format
  :param max_val: The maximum pixel valie in the image format
    If min_val and max_val are not specified, attempts to
    infer whether the image is in any of the common ranges:
      [0, 1], [-1, 1], [0, 255]
    This can be ambiguous, so it is better to specify if known.
  """
  as_pil(ndarray, min_val, max_val).save(path)