Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nawatts/pixel-map
Easy access to individual pixels in ImageData
https://github.com/nawatts/pixel-map
image-processing
Last synced: 5 days ago
JSON representation
Easy access to individual pixels in ImageData
- Host: GitHub
- URL: https://github.com/nawatts/pixel-map
- Owner: nawatts
- License: mit
- Created: 2016-08-03T00:32:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-12T23:57:22.000Z (over 8 years ago)
- Last Synced: 2024-12-23T01:34:24.346Z (14 days ago)
- Topics: image-processing
- Language: JavaScript
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pixel-map
Easy access to individual pixels in [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData).
```JavaScript
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;
```