bayer
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

bayer

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Compute the bayer matrix for powers of two. Useful for ordered dithering algorithms.

paypal coinbase twitter

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.

Package Sidebar

Install

npm i bayer

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

6.21 kB

Total Files

6

Last publish

Collaborators

  • dmnsgn