Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
glibsm committed Jun 18, 2020
1 parent b0ef3a6 commit 4bd2d75
Showing 1 changed file with 63 additions and 22 deletions.
85 changes: 63 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,70 @@ Color support may be added in the future.

## Example

![wizard](examples/wizard.jpg)
```
package main
import (
"image"
"log"
"os"
"github.com/glibsm/dots"
)
func main() {
bytes, err := os.Open("~/foo/bar")
if err != nil {
log.Fatal(err)
}
img, _, err := image.Decode(bytes)
if err != nil {
log.Fatal(err)
}
if err := dots.Write(img, dots.Width(100)); err != nil {
log.Fatal(err)
}
}
```

## Executable

This repo also contains a lightweight executable which makes use of the library
for your CLI needs.

Becomes
```
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⠋⠀⠀⠈⢻⣧⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣦⣿⣿⡆⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⠃⠀⠀⣾⣇⠈⣿⠀⠀⠀⠀⠀⠀⠐⣶⣆⢸⡟⣿⡿⣿⡀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡟⠀⠀⠀⣿⡿⣦⣿⡀⠀⠀⠀⠀⠀⠀⣾⣿⣿⠇⢹⡇⣿⡇⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⢾⡇⠀⠀⠀⠘⢿⣬⣭⣶⣶⣤⣄⣀⡀⠀⣹⡏⠉⠀⠛⠃⢹⣧⠀⠀
⠀⠀⠀⠀⠀⢰⣶⣤⣤⣴⡾⠋⠸⠷⠀⠀⠀⠀⠀⠉⣁⣠⣴⡾⠿⠛⢡⣾⣿⡶⠿⠛⠻⢷⣦⢻⣧⠀
⠀⠀⠀⠀⠀⠀⠙⠻⣷⣤⣄⣀⣀⣀⣀⣠⣤⣶⡾⠟⠛⠉⠁⠀⠀⠀⢸⣿⣿⠀⠀⠀⠀⢰⣿⢸⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⣿⡿⣿⣿⣿⢿⣶⡾⠟⠀⠀⠀⠀⢀⣠⣴⠿⣿⣧⣤⣤⣴⣿⢃⣾⠏⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣼⣷⡀⠉⠀⠀⠈⠁⣰⡿⢷⣤⡾⢟⣯⣶⠟⠛⠛⠻⣿⣿⡿⠟⠁⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⠟⠉⠙⠿⣶⣼⣷⣶⠿⣫⣾⣟⣭⣾⣟⠉⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢸⡏⠀⠀⠀⠀⠀⠀⢀⣤⣾⣫⣿⠋⢻⡞⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢰⣿⠁⠀⠀⠀⠀⢀⣴⣿⣿⢿⣿⣯⣴⠿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠸⣿⣠⣤⣤⣤⣾⣿⡿⠛⠁⢸⣿⠋⠁⢰⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣠⣿⠋⠉⣿⣿⠟⠉⠀⠀⠀⠀⠙⠿⢿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣴⣾⡿⣿⣤⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠉⠁⠀⠈⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣤⣼⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠻⣶⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢸⣟⠹⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣴⣦⣤⣀⡀⢈⣹⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠈⠻⣦⡀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣿⡋⠀⢀⣹⡿⠛⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠉⠻⢷⣦⣤⣤⣶⡾⠟⠛⠉⠉⠙⠛⠛⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
❯ go get -u github.com/glibsm/dots/cmd/dots
❯ dots -s ./examples/wizard.jpg -w 60
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣤⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣾⡿⠛⠛⠛⠿⣿⣷⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣤⣄⠠⣿⣦⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⠏⠀⠀⠀⠀⠀⠀⢻⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣷⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⠏⠀⠀⠀⢀⣶⡶⠀⠈⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣶⣦⡀⢸⣿⡿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⡟⠀⠀⠀⠀⢸⣿⣿⣆⠀⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣼⣿⡇⢹⣿⡇⣿⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⡿⠁⢸⣿⡇⢹⣿⡄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣸⣿⡇⠀⠀⠀⠀⠀⢻⣿⣶⣉⣉⣥⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⢹⣿⠋⠉⠁⠀⠻⠟⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⣿⢹⣿⡇⠀⠀⠀⠀⠀⠀⠀⠻⠿⠟⠛⠛⠛⢛⣻⣿⣷⣶⠆⠀⣠⣿⡿⣀⣤⣤⣤⣤⣤⣀⠈⣿⣿⡄⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣶⣶⣶⣿⠿⠛⠁⠈⠻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣴⣾⣿⠿⠛⠋⠁⠀⣾⣿⣿⣿⠿⠟⠋⠉⠛⠛⢿⣷⡄⢻⣿⡀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠿⣿⣯⣍⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣶⣿⣿⠿⠛⠋⠁⠀⠀⠀⠀⠀⢸⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⢸⣿⡇⢸⣿⡇⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⠿⢿⣿⣷⣶⣶⣶⣾⣿⡿⢿⡟⠛⢋⣵⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣻⣿⣿⣯⠀⠀⣀⠀⠀⣠⣾⡿⠀⣼⣿⠃⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣾⣿⠿⢿⣿⣿⣿⠿⠿⣿⣿⠟⠁⠀⡀⠀⠀⠀⠀⢀⣠⣴⣾⡿⢟⣿⣿⣦⣴⣦⣤⣾⣿⣿⣡⣼⣿⠏⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣻⣿⡄⠀⠙⠃⠀⠀⠀⠉⠁⠀⣠⣿⣿⣶⣄⣤⣾⣿⠟⣫⣵⣾⣿⠟⠻⠿⡿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⢠⣾⣿⣿⠿⣿⣦⡀⠀⢠⣤⠀⢀⣤⣾⣿⢟⣭⣿⣿⠟⣫⣴⣿⡿⠛⠉⠀⠀⠀⠀⠀⠉⠛⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⠟⠑⠀⠀⠉⠻⢿⣿⣾⣿⣿⠿⠟⢫⣴⣿⣿⣯⣴⣾⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⢟⣿⣿⠟⢻⣿⡸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⡅⢀⣸⣿⣇⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠇⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⠟⣿⣿⣵⣶⣿⠟⢻⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡄⢀⣀⣀⡀⢀⣤⣾⣿⣿⣿⡿⠋⠁⠀⣿⡟⠛⠉⠀⠀⣾⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⡿⠿⢿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⢿⣿⣦⣄⣤⣼⣿⣿⣿⡃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣾⣿⡟⠀⠀⣨⣿⣿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠛⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣏⣀⢶⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣼⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠐⠿⠿⠋⠉⠙⢿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣠⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⢿⣷⣦⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⡿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠻⠿⢿⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⡀⠙⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣴⣶⣿⣿⣷⣦⣀⣀⣀⣀⣠⣾⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣾⡿⠛⠁⠀⠀⠈⢻⣿⡿⠿⠿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⢿⣷⣤⡀⠀⠀⠀⠀⠀⠀⣀⣠⣴⣶⣿⠿⠿⣿⣿⣶⣤⣤⣴⣶⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⣿⣷⣶⣶⣾⣿⠿⠟⠋⠁⠀⠀⠀⠀⠈⠉⠋⠉⠉⠉⠀⠀⠀
```
Image courtesy of https://opengameart.org/users/gfx0

0 comments on commit 4bd2d75

Please sign in to comment.