now palette project lays here

This commit is contained in:
2026-03-04 22:13:30 +03:00
parent b9808c8150
commit 84d241e619
10 changed files with 35 additions and 6 deletions

BIN
pkg/dithering/IMG_0732.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 KiB

View File

@@ -0,0 +1,20 @@
//go:build ignore
package main
import (
"image/jpeg"
"image/png"
"os"
)
func main() {
img, err := jpeg.Decode(os.Stdin)
if err != nil {
panic(err)
}
err = png.Encode(os.Stdout, img)
if err != nil {
panic(err)
}
}

View File

@@ -1,6 +1,8 @@
package main package main
import ( import (
"image"
"git.nkpl.cc/twocookedfaggots/imageutils/pkg/dithering" "git.nkpl.cc/twocookedfaggots/imageutils/pkg/dithering"
"git.nkpl.cc/twocookedfaggots/imageutils/util" "git.nkpl.cc/twocookedfaggots/imageutils/util"
) )

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

1
pkg/palette Submodule

Submodule pkg/palette added at e161720f1c

View File

@@ -1,9 +1,9 @@
package imageutils package util
import ( import (
"errors"
"fmt" "fmt"
"image/color" "image/color"
"errors"
) )
var ParseHexColorErr = errors.New("invalid length, must be 7 or 4") var ParseHexColorErr = errors.New("invalid length, must be 7 or 4")

View File

@@ -1,4 +1,4 @@
package imageutils package util
import ( import (
"fmt" "fmt"

View File

@@ -1,7 +1,13 @@
package imageutils package util
import (
"image"
"image/png"
"os"
)
// ProcessImage takes input png image from stdin, processes it with f and outputs it to stdout. // ProcessImage takes input png image from stdin, processes it with f and outputs it to stdout.
func ProcessStdio(f func(image.Image) image.Image) { func ProcessStdio(f func(image.Image) image.Image) error {
img, err := png.Decode(os.Stdin) img, err := png.Decode(os.Stdin)
if err != nil { if err != nil {
return err return err