This commit is contained in:
2026-03-29 17:03:48 +03:00
parent 7143e96ef3
commit 3880b353c1
20 changed files with 491 additions and 23 deletions

View File

@@ -5,6 +5,8 @@ import (
"image/color"
"image/png"
"os"
"git.nkpl.cc/twocookedfaggots/imageutils/util"
)
func NegateRGBA(c color.RGBA) color.RGBA {
@@ -30,15 +32,10 @@ func (n Negate) At(x, y int) color.Color {
return NegateRGBA(RGBAColor)
}
func check(err error) {
if err != nil {
func main() {
if err := util.ProcessStdio(func(img image.Image) image.Image {
return Negate{img}
}); err != nil {
panic(err)
}
}
func main() {
img, err := png.Decode(os.Stdin)
check(err)
err = png.Encode(os.Stdout, Negate{img})
check(err)
}