now palette project lays here
This commit is contained in:
BIN
pkg/dithering/IMG_0732.jpg
Normal file
BIN
pkg/dithering/IMG_0732.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 424 KiB |
20
pkg/dithering/cmd/jpg2png.go
Normal file
20
pkg/dithering/cmd/jpg2png.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
)
|
)
|
||||||
|
|||||||
BIN
pkg/dithering/cmd/nz9ipc5vywca1.jpg
Normal file
BIN
pkg/dithering/cmd/nz9ipc5vywca1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
BIN
pkg/dithering/cmd/something.png
Normal file
BIN
pkg/dithering/cmd/something.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 145 KiB |
BIN
pkg/dithering/cmd/touhouthemedbj.png
Normal file
BIN
pkg/dithering/cmd/touhouthemedbj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
1
pkg/palette
Submodule
1
pkg/palette
Submodule
Submodule pkg/palette added at e161720f1c
@@ -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")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package imageutils
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user