quantize

WebJar for quantize

Лицензия

Лицензия

MIT
Категории

Категории

Ant Компиляция и сборка Github Инструменты разработки Контроль версий
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-lokesh-quantize
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

quantize
WebJar for quantize
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/lokesh/quantize

Скачать github-com-lokesh-quantize

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-lokesh-quantize/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-lokesh-quantize</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-lokesh-quantize/
implementation 'org.webjars.npm:github-com-lokesh-quantize:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-lokesh-quantize/
implementation ("org.webjars.npm:github-com-lokesh-quantize:1.1.0")
'org.webjars.npm:github-com-lokesh-quantize:jar:1.1.0'
<dependency org="org.webjars.npm" name="github-com-lokesh-quantize" rev="1.1.0">
  <artifact name="github-com-lokesh-quantize" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-lokesh-quantize', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-lokesh-quantize" % "1.1.0"
[org.webjars.npm/github-com-lokesh-quantize "1.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

quantize

Node.js module for color quantization, based on Leptonica.

Install

npm install quantize

Quick Overview

Usage

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.

// 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.

// Returns the reduced pixel
colorMap.map(arrayOfPixels[0]);
// [188,196,188]

Author

Contributors

License

Licensed under the MIT License.

Версии библиотеки

Версия
1.1.0