A library and CLI tool for pixel sorting
- Clone this repo
cd cmd/gopixel
go build
./gopixel <input-file> [sort-angle] > <output-file>
GoPixel can read files in PNG format, and writes PNG formatted files to stdout.
package main
import (
"image"
"log"
"os"
gopixel "github.com/niksko/gopixel/pkg/sort"
)
func main() {
reader, err := os.Open("somepath/myimage.png")
if err != nil {
log.Fatal(err)
}
defer reader.Close()
var img image.Image
img, _, err = image.Decode(reader)
if err != nil {
log.Fatal(err)
}
sortedImage, err := gopixel.Sort(img, 270)
if err != nil {
log.Fatal(err)
}
}
See the feature list.