code: def read_multipage(filename, flags=0):
      """Read a multipage image to a list of numpy arrays, where each
      array is of shape (width, height) for greyscale images, or shape
      (nchannels, width, height) for RGB or RGBA images.
  
      """
      ftype = _FI.FreeImage_GetFileType(_bytestr(filename), 0)
      if ftype == -1:
          raise ValueError(
              "mahotas.freeimage: cannot determine type of file %s"
              % filename
          )
      create_new = False
      read_only = True
      keep_cache_in_memory = True
      multibitmap = _FI.FreeImage_OpenMultiBitmap(
          ftype,
          _bytestr(filename),
          create_new,
          read_only,
          keep_cache_in_memory,
          flags,
      )
      if not multibitmap:
          raise ValueError(
              "mahotas.freeimage: could not open %s"
              " as multi-page image." % filename
          )
      try:
          pages = _FI.FreeImage_GetPageCount(multibitmap)
          arrays = []
          for i in range(pages):
              bitmap = _FI.FreeImage_LockPage(multibitmap, i)
              try:
                  arrays.append(_array_from_bitmap(bitmap))
              finally:
                  _FI.FreeImage_UnlockPage(multibitmap, bitmap, False)
          return arrays
      finally:
          _FI.FreeImage_CloseMultiBitmap(multibitmap, 0)
  
imports: import sys
  import os
  import ctypes
  import ctypes.util
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: read_multipage(filename, flags) and returns: arrays