Convert PNG image to ANSI art using UTF-8 characters.
For best results it is necessary to use a font compatible with characters "█", "▀", "▄", I recommend the source code pro fount or even better use the 3270font.
go install crg.eti.br/go/pngtoansi/cmd/pngtoansi
go get crg.eti.br/go/pngtoansi
pngtoansi -f ./examples/gopher.png
Adjusted the background color. It is possible to change the color used to replace the transparent background using the -rgb parameter.
pngtoansi -f ./examples/test-01.png -rgb FFFFFF
...
p := pngtoansi.New()
err = p.PrintFile("./examples/gopher.png", "FFFFFF")
if err != nil {
fmt.Println(err)
return
}
- Fork the repo on GitHub
- Clone the project to your own machine
- Create a branch with your modifications
git checkout -b fantastic-feature
. - Then commit your changes
git commit -m 'Implementation of new fantastic feature'
- Make a push to your branch
git push origin fantastic-feature
. - Submit a Pull Request so that we can review your changes