code: function fileToCanvas(file, done) {
    var canvas = document.createElement('canvas');
    var ctx = canvas.getContext('2d');
    var img = document.createElement('img');
    img.onload = function() {
      canvas.width = img.naturalWidth;
      canvas.height = img.naturalHeight;
      ctx.drawImage(img, 0, 0);
      done(null, canvas);
    };
    img.onerror = function(err) {
      done(err);
    };
    img.src = URL.createObjectURL(file);
  }
docs: Convert an image file into a canvas.