raulpy271 / library-to-manipulate-canvas

๐Ÿ–Œ๏ธ A simple javascript library for editing images on the canvas element

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lib to manipulate the canvas

This is a simple JS library that manipulate the pixels of the canvas and apply filters to it.

How to use

The lib is very light and use pure JS, so you can use in the browser without nodeJS only calling <script src="/loadInWindow.js"></script> in your html.

Manipulate pixels

var manCanvas = new ManipulateCanvas(canvas);

// get pixel with the coordinate (x, y)

manCanvas.getPixel(x, y);

//change pixel with coordinate (x, y) to the white pixel

manCanvas.setPixel(x, y, [255, 255, 255, 255]);

Filters

var manCanvas = new ManipulateCanvas(canvas);

// change to grayscale

manCanvas.grayscale()

// change brigthness and contrast

manCanvas.brigthness(intensity)

manCanvas.contrast(intensity)

TODO

  • Add more filters

About

๐Ÿ–Œ๏ธ A simple javascript library for editing images on the canvas element


Languages

Language:JavaScript 100.0%