pixel-map

1.1.0 • Public • Published

pixel-map

Easy access to individual pixels in ImageData.

import PixelMap from 'pixel-map';
 
const imageData = new ImageData(100, 100);
const pix = new PixelMap(imageData);
 
// Access by row and column
pix.at(0, 0).r = 255;
pix.at(0, 0).g = 0;
pix.at(0, 0).b = 0;
pix.at(0, 0).a = 255;
 
// Access by index
pix.atIndex(0).r = 255;
pix.atIndex(0).g = 0;
pix.atIndex(0).b = 0;
pix.atIndex(0).a = 255;

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i pixel-map

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • nawatts