Skip to content

Commit 7df0b6c

Browse files
committed
Enhance image processing by adding additional dither modes: Atkinson and Burkes
1 parent 47cce14 commit 7df0b6c

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Prints an image from base64-encoded data.
186186
**Parameters:**
187187
- `data` (string): Base64-encoded image data (PNG format recommended)
188188
- `alignment` (string): Image alignment - `"left"`, `"center"`, or `"right"`
189-
- `dither-mode` (string): Dithering algorithm - `"none"` or `"floydsteinberg"`
189+
- `dither-mode` (string): Dithering algorithm - `"floydsteinberg"`, `"atkinson"`, `"burkes"`, and `"none"`.
190190

191191
## Response Codes
192192

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ func processImage(i Image) image.Image {
5959
case "floydsteinberg":
6060
d.Matrix = dither.FloydSteinberg
6161
return d.Dither(i.img)
62+
case "atkinson":
63+
d.Matrix = dither.Atkinson
64+
return d.Dither(i.img)
65+
case "burkes":
66+
d.Matrix = dither.Burkes
67+
return d.Dither(i.img)
6268
case "none":
6369
return i.img
6470
default:

0 commit comments

Comments
 (0)