code: def _convert(array, matrix, dtype, funcname):
      _check_3(array, funcname)
      h, w, d = array.shape
      array = array.transpose((2, 0, 1))
      array = array.reshape((3, h * w))
      array = np.dot(matrix, array)
      array = array.reshape((3, h, w))
      array = array.transpose((1, 2, 0))
      if dtype is not None:
          array = array.astype(dtype, copy=False)
      return array
  
file_path: mahotas/mahotas/colors.py
imports: from __future__ import division
  import numpy
  from .internal import _check_3
label_desc: Use image node_id 2 for calling a global function with example usage: _convert(array, matrix, dtype, funcname) and returns: array