code: def imreadfromblob(blob, ftype=None, as_grey=False):
      """
      arr = imreadfromblob(blob, ftype={auto}, as_grey=False)
  
      Read an image from a blob (string)
  
      Parameters
      ----------
      blob : str
          Input
      filetype : integer, optional
          input type. By default, infer from image.
      as_grey : boolean, optional
          whether to convert colour images to grey scale
  
      Returns
      -------
      arr : ndarray
      """
      try:
          mem = _FI.FreeImage_OpenMemory(blob, len(blob))
          if ftype is None:
              ftype = _FI.FreeImage_GetFileTypeFromMemory(mem, 0)
          bitmap = _FI.FreeImage_LoadFromMemory(ftype, mem, 0)
          img = _array_from_bitmap(bitmap)
          if as_grey and len(img.shape) == 3:
              # these are the values that wikipedia says are typical
              transform = np.array([0.30, 0.59, 0.11])
              return np.dot(img, transform)
          return img
      finally:
          _FI.FreeImage_CloseMemory(mem)
  
imports: import sys
  import os
  import ctypes
  import ctypes.util
  import numpy
label_desc: Use image node_id 13 for calling a global function with example usage: imreadfromblob(blob, ftype, as_grey) and returns: img, np