to-image-data

0.0.2 • Public • Published

to-image-data

Convert Nested Numerical Arrays into ImageData

features

  • Handles Numerical Arrays in Any Layout
  • Handles Missing Alpha Band

install

npm install to-image-data

usage

import toImageData from "to-image-data";

const bands = [
  [123, 42, 42, ... ], // red
  [44, 84, 12, ... ], // green
  [48, 72, 52, ... ], // blue
];

const imageData = toImageData(bands);
// { height: 768, width: 1024, data: Uint8ClampedArray[123, 44, 48, 255, 42, 84, 72, 255, ...] }

Package Sidebar

Install

npm i to-image-data

Weekly Downloads

3,262

Version

0.0.2

License

CC0-1.0

Unpacked Size

10.6 kB

Total Files

4

Last publish

Collaborators

  • danieljdufour