File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,29 @@ Dithering algorithms implemented in Nim
44## API
55
66[ API Documentation] ( https://nycto.github.io/dither-nim/ )
7+
8+ ## Algorithms
9+
10+ This library supports two primary classifications of algorithms:
11+
12+ * __ [ Ordered Dithering] ( https://en.wikipedia.org/wiki/Ordered_dithering ) __ : This is a fast dithering algorithm that uses
13+ a matrix of predefined values to vary what color is selected.
14+ * __ [ Error Diffusion] ( https://en.wikipedia.org/wiki/Error_diffusion ) __ : A slightly slower dithering algorithm that
15+ tracks the error incurred when a color is clamped to the palette, then distributes that error to surrounding pixels.
16+
17+ A more detailed list of supported algorithms can be found here:
18+
19+ https://nycto.github.io/dither-nim/dither/types.html#DitherModes
20+
21+ ## Example
22+
23+ A working example that uses [ pixie] ( https://github.com/treeform/pixie ) for images and
24+ [ chroma] ( https://github.com/treeform/chroma ) for colors can be seen here:
25+
26+ https://github.com/Nycto/dither-nim/blob/main/example/src/dither_img.nim
27+
28+ ## A note on concepts
29+
30+ This library uses Nim [ concepts] ( https://nim-lang.org/docs/manual_experimental.html#concepts ) to control the inputs
31+ to its algorithms. This allows it to integrate with arbitrary image, color, and palette libraries -- as long as they
32+ implement the interface described by the concepts.
You can’t perform that action at this time.
0 commit comments