Is it possible to get pixels array in nodeJs without canvas or smth like that? Suppose I have image path. I tried several libraries but all of them need canvas or there's error with 'SOI not found'.
For example that:
var getPixels = require('get-image-pixels')
var data = getPixels('0.jpg');
Unhandled rejection Error: SOI not found
Or that:
var image = require('get-image-data')
image('0.jpg', function(error, info) {
var height = info.height
var width = info.width
var data = info.data
for (var i = 0, l = data.length; i < l; i += 4) {
var red = data[i]
var green = data[i + 1]
var blue = data[i + 2]
var alpha = data[i + 3]
}
})
module.js:557 throw err;
Error: Cannot find module 'canvas'