mcfsd

Multicolor Floyd Steinberg dithering.

Usage no npm install needed!

<script type="module">
  import mcfsd from 'https://cdn.skypack.dev/mcfsd';
</script>

README

✨ MCFSD

Multicolored Floyd Steinberg Dithering


🔽 Installation

$ npm install mcfsd

❔ Basic Usage Example (Jimp)

const Jimp = require("jimp");
const mcfsd = require("mcfsd");

(async () => {
  let image = await Jimp.read("example.jpg");

  //
  //             Dithering Factor ---------+---> Every what pixel(s)
  //                                       |
  //             Image Bitmap -|           |
  //                           V           V
  let ditheredBitmap = await mcfsd(image.bitmap, 5);

  let ditheredImage = await Jimp.create(ditheredBitmap);

  await ditheredImage.writeAsync("dithered_example.jpg");
})();