/gopixel

A pixel sorting application and library written in Go

Primary LanguageGo

GoPixel

A library and CLI tool for pixel sorting

CLI usage

  1. Clone this repo
  2. cd cmd/gopixel
  3. go build
  4. ./gopixel <input-file> [sort-angle] > <output-file>

GoPixel can read files in PNG format, and writes PNG formatted files to stdout.

Library usage

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)
    }
}

Feature list

See the feature list.