jsimp

0.0.2 • Public • Published

jsimp

JavaScript Image Processor

Installation

HTML

<body>
  ...
  <script type="text/javascript" src="/path/to/jsimp.js"></script> 
</body>

Usage

In your HTML, create the canvas element and add the code that loads the required image on the canvas.

<canvas id="canvas"></canvas>
<script type="text/javascript">
/*
* Code that loads the required image on the canvas.
*/
</script> 

Once the image is loaded on the canvas, you can create the JSIMP object and start processing the image.

var canvas = document.getElementById('canvas');
 
//Create a JSIMP object
var jsImp = new JSIMP();
 
//Load image data from the canvas.
jsImp.loadImgFromCanvas(canvas);
 
//Do the processing
jsImp.invertColors();
jsImp.greyScale();
 
//Load the processed image back to the canvas
jsImp.loadImgToCanvas(canvas);

License

Code released under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i jsimp

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • butane