2.1.12 • Published 3 months ago
mediancut v2.1.12
MedianCut
Demo
Usage
Install
<script type="text/javascript" src="https://unpkg.com/mediancut@latest"></script>
or
import MedianCut from 'mediancut';
Sample
// Get context
const ctx = document.getElementById('canvas').getContext('2d');
// Get Imagedata
const imagedata = ctx.getImageData(0, 0, CANVAS_SIZE, CANVAS_SIZE);
// Reduced to 16 colors
const medianCut = new MedianCut(imagedata);
const reducedImageData = medianCut.reduce(16);
// Draw
ctx.putImageData(reducedImageData, 0, 0, 0, 0, CANVAS_SIZE, CANVAS_SIZE);
Development
Installing
# Install npm packages
npm i
Running
# Watch JS & CSS
npm run watch
# Up Server
npm run server
2.1.12
3 months ago
2.1.11
3 months ago
2.1.8
3 months ago
2.1.6
3 months ago
2.1.7
3 months ago
2.1.4
3 months ago
2.1.5
3 months ago
2.1.3
4 months ago
2.1.1
4 months ago
2.0.5
3 years ago
2.1.0
3 years ago
2.0.4
3 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago