Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 882 Bytes

README.md

File metadata and controls

59 lines (38 loc) · 882 Bytes

ansipix

As seen on http://curlgur.tk

image to ansi blocks in Go

gopher

Can I try it?

Sure, build ansipix.go in the /bin/ folder and you're good to go.

$ ./ansipix octocat.jpg 50

  • First argument is filename
  • 2nd is width in columns (default 80)

octocat

Can I use it?

Sure, just

$ go get "github.com/minikomi/ansipix"

Then pass an io.Reader & width as an int to Blockify:

package main

// AnsipixOnPipe.go
import (
	"bufio"
	"fmt"
	"github.com/minikomi/ansipix"
	"os"
)

func main() {
	Stdin := bufio.NewReader(os.Stdin)

	str, err := ansipix.Blockify(Stdin, 80)
	if err != nil {
		panic(err)
	}

	fmt.Println(str)
}

and

curl https://www.google.com/images/srpr/logo4w.png | go run test.go

google

Have fun! :octocat: