Skip to content

minikomi/ansipix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

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:

About

Image to ansiblocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages