As seen on http://curlgur.tk
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)
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
Have fun!