Skip to content

Commit 48c910c

Browse files
committed
Add details to readme
1 parent b9483fa commit 48c910c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)