Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crgimenes/pngtoansi
Convert PNG files to ANSI art
https://github.com/crgimenes/pngtoansi
ansi-art ansi-colors ansi-escape go golang golang-package png
Last synced: 29 days ago
JSON representation
Convert PNG files to ANSI art
- Host: GitHub
- URL: https://github.com/crgimenes/pngtoansi
- Owner: crgimenes
- License: mit
- Archived: true
- Created: 2020-02-27T00:13:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T01:38:46.000Z (almost 2 years ago)
- Last Synced: 2024-06-19T16:46:38.563Z (6 months ago)
- Topics: ansi-art, ansi-colors, ansi-escape, go, golang, golang-package, png
- Language: Go
- Homepage:
- Size: 117 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - pngtoansi - 8 (Repositories)
README
# pngtoansi
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](https://github.com/adobe-fonts/source-code-pro) fount or even better use the [3270font](https://github.com/rbanffy/3270font).
## Install
### Install as a Utility
```console
go install crg.eti.br/go/pngtoansi/cmd/pngtoansi
```### Install as a Golang package
```console
go get crg.eti.br/go/pngtoansi
```## Examples
### Convert PNG to ANSI in the terminal
```console
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.
```console
pngtoansi -f ./examples/test-01.png -rgb FFFFFF
```### Golang example
```golang
...
p := pngtoansi.New()
err = p.PrintFile("./examples/gopher.png", "FFFFFF")
if err != nil {
fmt.Println(err)
return
}
```## Contributing
- 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