# Dither Me This (library)

- Author: ShadowfaxRodeo (doodad.dev)
- Source: https://github.com/ShadowfaxRodeo/dither-me-this
- Commit: 5812b6fd01f6118152f121a17cf06eb7f80a7e9c (main, package version 0.0.5)
- Licence: MIT (./LICENSE, copied from license.txt; package.json says "ISC", the repository's licence file is MIT)
- What this is: dither-me-this is a build-time Node library (no web UI). Its src/ is plain JavaScript that works on
  ImageData; the `canvas` dependency in package.json is not required by src/. So it was bundled for the browser:
  `npx esbuild@0.25.0 src/index.js --bundle --format=iife --global-name=ditherMeThis --legal-comments=inline --outfile=dither-me-this.js`
  (no code changes). The doodad.dev "Dither Me This" web app itself is a different, unpublished code base and is not shown.
- Vendored files: dither-me-this.js (the bundle above), palettes.js (the library's src/data/default-palettes.json
  verbatim, wrapped as `window.DMT_PALETTES = …`), LICENSE
- Added by Web Curio: index.html (host page written for the museum: a procedurally generated landscape or a
  user-chosen/dropped image is downscaled by a pixel-size setting and passed to `ditherMeThis(imageData, options)`;
  algorithm, palette and pixel size are selectable; press to compare with the original), stage.html (index.html plus
  the museum's CSP meta and sandbox shim), this file
- Notes on using the library as published: the option `type` must be one of `error_diffusion`, `ordered`, `random`,
  `color_reduction` (the README's camelCase names and the default "errorDiffusion" do nothing), and the colour
  distance needs [r,g,b] arrays, so the page converts hex palettes to RGB before calling it. The three library presets
  are labelled 库自带; CGA, sepia and night palettes were added by the museum.
