Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mncaudill/3bitdither
Dithering that runs completely client-side
https://github.com/mncaudill/3bitdither
Last synced: 3 days ago
JSON representation
Dithering that runs completely client-side
- Host: GitHub
- URL: https://github.com/mncaudill/3bitdither
- Owner: mncaudill
- License: mit
- Created: 2012-04-01T06:30:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-08-05T15:57:06.000Z (over 11 years ago)
- Last Synced: 2024-08-02T05:11:37.034Z (3 months ago)
- Homepage: http://mncaudill.github.com/3bitdither
- Size: 53.7 KB
- Stars: 23
- Watchers: 0
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
3 Bit Dither
==============
Implemented by Nolan CaudillThis demo currently uses two different error-diffusion dithering algorithms: Atkinson's and the Floyd-Steinberg algorithm.
Error-diffusion means that the algorithm goes pixel by pixel, rounds the individual R, G, and B channels to either 0x00 or 0xff, and then distributes those differences (which the algorithm calls the "quantization error") in differing amounts to pixels further down the line. It being a 3-bit dithering means that your red, blue, and green channels are represented by a single bit (off or on), giving you a total of 8 colors.
The demo also does halftone dithering and Bayer dithering (just 2 bit) which don't use error-diffusion, which for these two makes the patterns evident that error-diffusion usually lessens.
This runs completely client-side, using the FileReader and canvas APIs. If you have a somewhat modern browser, this should work. Also, you can right-click and save the result of the dithering.
The demo lives here.