function processCanvas (canvas) {
  var context = canvas.getContext('2d');
  var pixels = context.getImageData(0, 0, canvas.width, canvas.height);

  var shape = [canvas.width, canvas.height, 4];
  var stride = [4, 4 * canvas.width, 1];
  var wxh = ndarray(new Uint8Array(pixels.data), shape, stride, 0);
  var hxw = wxh.transpose(1, 0);

  if (isGrayscale(hxw)) {
    hxw = hxw.pick(null, null, 0);
  }
  return new NdArray(hxw);
}
This callback type is called `imgCallback` and is displayed as a global symbol.

@callback imgCallback
@param {err} error - if any, null otherwise
@param {NdArray} - image represented as a (H, W, [K,]) array, with K the number of color channels. if image is grayscale (or B&W) then image only have two dimensions H and W