bayer
v1.0.3
Published
Compute the bayer matrix for powers of two. Useful for ordered dithering algorithms.
Downloads
6
Maintainers
Readme
bayer
Compute the bayer matrix for powers of two. Useful for ordered dithering algorithms.
Installation
npm install bayer
Usage
import bayer from "bayer";
const matrix = bayer();
// => [
// [0, 2],
// [3, 1],
// ];
API
bayer(size) ⇒ Array.<Array>
Compute the bayer matrix for powers of two.
Kind: global function Returns: Array.<Array> - A 2D array containing the matrix.
| Param | Type | Default | Description | | ----- | ------------------- | -------------- | ------------------------------------------------------------------------------------------- | | size | number | 2 | Needs to be a power of two otherwise will throw a "Maximum call stack size exceeded" Error. |
License
MIT. See license file.