Skip to content

gridjs/gridjs

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

GridJS

GridJS is a JavaScript imaging library for web programming.

HOW TO USE

Add GridJS to your page

<script src="//cdn.jsdelivr.net/gridjs/latest/gridjs.min.js"></script>

Then open an image from URL

gridjs.open(url, function(im) {
  ...
});

You may process im with methods in API Docs. For example, convert im to grayscale

im.grayscale();

or resize im to new size

im.resize(100, 100);

or resize im then covert to grayscale

im.resize(100, 100).grayscale();

If you'd like to show im, create a canvas element

var canvas = document.create('canvas');
document.getElementsByTagName('body')[0].appendChild(canvas);

then call show method

im.show(canvas);

or just

im.resize(100, 100).grayscale().show(canvas);

Most methods modify origin data(except copy and load), so you may write code like this

im.resize(100, 100);
im.grayscale();
im.show(canvas);

LICENSE

Code licensed under The MIT License. Documentation licensed under CC BY 3.0.