Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skarab42/lw.canvas-filters

Canvas filters for LaserWeb
https://github.com/skarab42/lw.canvas-filters

Last synced: 15 days ago
JSON representation

Canvas filters for LaserWeb

Awesome Lists containing this project

README

        

# lw.canvas-filters
SVG path for [LaserWeb/CNCWeb](https://github.com/LaserWeb/LaserWeb4).

## Installation
Using NPM
```
npm install lw.canvas-filters
```

Using GIT
```
git clone https://github.com/lautr3k/lw.canvas-filters.git
cd canvas-filters
npm install
```

Or download the last build from https://raw.githubusercontent.com/lautr3k/lw.canvas-filters/master/dist/lw.canvas-filters.js
```html

var path = CanvasFilter.canvasFilter();

```

## Settings
```javascript
let settings = {
smoothing : false, // Smoothing [true|fale]
brightness : 0, // Image brightness [-255 to +255]
contrast : 0, // Image contrast [-255 to +255]
gamma : 0, // Image gamma correction [0.01 to 7.99]
grayscale : 'none', // Graysale algorithm [average, luma, luma-601, luma-709, luma-240, desaturation, decomposition-[min|max], [red|green|blue]-chanel]
shadesOfGray: 256, // Number of shades of gray [2-256]
invertColor : false // Invert color...
}
```

## Usages
```javascript
import canvasFilter from 'canvas-filters'

canvasFilter(canvas, settings)
```