The classic Macintosh 1-bit filter, as used by HyperDither.
This project was originally created 2010-2016 by @gazs (sources, live demo).
Compares every pixel to 50% grey, then changes them to either black or white. The difference between the input and the output is then distributed to the neighbouring pixels as follows (X is the current pixel):
X 1/8 1/8
1/8 1/8 1/8
1/8
Example screenshot:
Requires npm
.
Start a local web server to run the demo app:
./start.sh
This code uses Drag and Drop events, WebWorkers, and the FileReader API.