dithering done :)

This commit is contained in:
2026-03-04 21:44:20 +03:00
parent e5c0537f2b
commit b9808c8150
7 changed files with 102 additions and 97 deletions

14
util/stdio.go Normal file
View File

@@ -0,0 +1,14 @@
package imageutils
// ProcessImage takes input png image from stdin, processes it with f and outputs it to stdout.
func ProcessStdio(f func(image.Image) image.Image) {
img, err := png.Decode(os.Stdin)
if err != nil {
return err
}
err = png.Encode(os.Stdout, f(img))
if err != nil {
return err
}
return err
}