SVG path for LaserWeb/CNCWeb.
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
<script src="https://github.com/skarab42/lw.canvas-filters/raw/master/lw.canvas-filters.js"></script>
<script>
var path = CanvasFilter.canvasFilter();
</script>
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...
}
import canvasFilter from 'canvas-filters'
canvasFilter(canvas, settings)