pixel

0.1.3 • Public • Published

Pixel

Npm version Build Status

Get ImageData in cross-platform

Installation

for NodeJS

$ yarn add pixel
# or 
$ npm install pixel --save

for Browser

<script src="https://unpkg.com/pixel"></script>
<script>
  console.log(pixel); //function
</script> 

API

pixel(file) -> Promise<ImageData[]>

return images is Array contains one or more ImageData.

Return the object instead of ImageData at Node.js

file is...

  • string: url (e.g. http[s]://...)
  • string: datauri (e.g. data:image/...)
  • string: path (e.g. /path/to/file)
  • string: binary (unless above)
  • object: Blob/File
  • object: Buffer/ArrayBuffer/Uint8Array/Uint8ClampedArray
  • object: HTMLImageElement

Support

  • gif (static/animation)
  • png (static/animation)
  • jpeg
  • bitmap (24bit or less)
  • webp (static/animation)

Related projects

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i pixel

Weekly Downloads

10

Version

0.1.3

License

MIT

Unpacked Size

1.87 MB

Total Files

8

Last publish

Collaborators

  • 59naga