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

1.0.4 • 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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i bayer

      Weekly Downloads

      15

      Version

      1.0.4

      License

      MIT

      Unpacked Size

      6.43 kB

      Total Files

      6

      Last publish

      Collaborators

      • dmnsgn