0.1.1 • Published 9 years ago
pixel-js v0.1.1
Pixel
Digital Image Processing in Javascript and CSS.
Installation
NPM
npm install pixel-js --saveStandalone
Use the standalone version in the dist/iife/pixel.js folder.
Use <script> tag to load the file:
<script src="path/to/pixel.js"></script>ES6 and AMD support
dist/es6/pixel.jsdist/amd/pixel.js
Demo
or
npm install && npm startAPI
Pixel.loadImage
Pixel.loadImage("imageSrc").then((image) => {
// Now image is ready
}, (error) => {
// If load failed...
});Pixel.Canvas(selector, image, width, height)
Arguments:
- selector
String|Element - image
Image - width
Number - height
Number
Return:
Canvas
Pixel.Canvas.prototype.repaint()
Trigger repaint.
Arguments:
- none
Return:
this
Pixel.Canvas.prototype.clear()
Arguments:
- none
Return:
this
Pixel.Canvas.prototype.reset()
Arguments:
- none
Return:
this
Pixel.Canvas.complement()
Arguments:
- none
Return:
Promise
Pixel.Canvas.linear(x, y)
Rules:
r' = x * r + yg' = x * g + yb' = x * b + ya' = a
Arguments:
- x
Number - y
Number
Return:
Promise