Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

get-image-data

5.0.0 • Public • Published

get-image-data

isomorphic image data extraction

ci

install

npm install michaelrhodes/get-image-data#5.0.0 [jimp] [sharp]

use

// Extract data with canvas element or `jimp`
var image = require('get-image-data')
 
image('./image.jpg', function (err, info) {
  var data = info.data
  var height = info.height
  var width = info.width
 
  for (var i = 0, l = data.length; i < l; i += 4) {
    var red = data[i]
    var green = data[+ 1]
    var blue = data[+ 2]
    var alpha = data[+ 3]
  }
})
 
// Extract data with `sharp` (faster)
var image = require('get-image-data/native')

obey

CC0-1.0

Keywords

none

Install

npm i get-image-data

DownloadsWeekly Downloads

299

Version

5.0.0

License

CC0-1.0

Unpacked Size

2.58 kB

Total Files

5

Last publish

Collaborators

  • avatar