Unified method of retrieving an ImageData instance from an image, in both the browser and Node.js, asynchronously or synchronously