code: def imread(filename, as_grey=False):
      """Read an image into a ndarray from a file.
  
      This function depends on PIL (or Pillow) being installed.
  
      Parameters
      ----------
      filename : str
          filename
      as_grey : boolean, optional
          Whether to convert to grey scale image (default: no)
      """
      im = Image.open(filename)
      array = np.array(im)
      if as_grey and array.ndim != 2:
          array = mh.colors.rgb2grey(array)
      return array
  
imports: import numpy
  import mahotas
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: imread(filename, as_grey) and returns: array