WILL NOT BE MAINTAINED; published fork pending update of main get-pixels package.
Currently the following file formats are supported:
var getPixels =
npm install get-pixels
require("get-pixels")(url[, type], cb(err, pixels))
Reads all the pixels from url into an ndarray.
urlis the path to the file. It can be a relative path, an http url, a data url, or an in-memory Buffer.
typeis an optional mime type for the image (required when using a Buffer)
cb(err, pixels)is a callback which gets triggered once the image is loaded.
Returns An ndarray of pixels in raster order having shape equal to
[width, height, channels].
Note For animated GIFs, a 4D array is returned with shape
[numFrames, width, height, 4], where each frame is a slice of the final array.
(c) 2013-2014 Mikola Lysenko. MIT License