Compute the bayer matrix for powers of two. Useful for ordered dithering algorithms.
npm install bayer
import bayer from "bayer";
const matrix = bayer();
// => [
// [0, 2],
// [3, 1],
// ];
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. |
MIT. See license file.