StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
62 lines
1.2 KiB
4 years ago
|
quantize
|
||
|
========
|
||
|
|
||
|
Node.js module for color quantization, based on Leptonica.
|
||
|
|
||
|
Install
|
||
|
-------
|
||
|
|
||
|
npm install quantize
|
||
|
|
||
|
Quick Overview
|
||
|
--------------
|
||
|
|
||
|
###Usage
|
||
|
|
||
|
`````javascript
|
||
|
var quantize = require('quantize');
|
||
|
|
||
|
var arrayOfPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207]];
|
||
|
var maximumColorCount = 4;
|
||
|
|
||
|
var colorMap = quantize(arrayOfPixels, maximumColorCount);
|
||
|
`````
|
||
|
|
||
|
* `arrayOfPixels` - An array of pixels (represented as [R,G,B arrays]) to quantize
|
||
|
* `maxiumColorCount` - The maximum number of colours allowed in the reduced palette
|
||
|
|
||
|
#####Reduced Palette
|
||
|
|
||
|
The `.palette()` method returns an array that contains the reduced color palette.
|
||
|
|
||
|
`````javascript
|
||
|
// Returns the reduced palette
|
||
|
colorMap.palette();
|
||
|
// [[204, 204, 204], [208,212,212], [188,196,188], [212,204,196]]
|
||
|
`````
|
||
|
|
||
|
#####Reduced pixel
|
||
|
|
||
|
The `.map(pixel)` method maps an individual pixel to the reduced color palette.
|
||
|
|
||
|
`````javascript
|
||
|
// Returns the reduced pixel
|
||
|
colorMap.map(arrayOfPixels[0]);
|
||
|
// [188,196,188]
|
||
|
`````
|
||
|
|
||
|
Author
|
||
|
------
|
||
|
|
||
|
* [Olivier Lesnicki](https://github.com/olivierlesnicki)
|
||
|
|
||
|
Contributors
|
||
|
------------
|
||
|
|
||
|
* [Nick Rabinowitz](https://github.com/nrabinowitz)
|
||
|
* [Mike Bostock] (https://github.com/mbostock)
|
||
|
|
||
|
License
|
||
|
-------
|
||
|
|
||
|
Licensed under the MIT License.
|