mirror of
https://github.com/imjasonh/dots
synced 2026-07-07 00:22:55 +00:00
No description
- golang.org/x/image v0.40.0 => v0.41.0 - golang.org/x/sys v0.44.0 => v0.45.0 (indirect) - golang.org/x/term remains at v0.43.0 (already latest) Co-authored-by: Jason Hall <imjasonh@users.noreply.github.com> |
||
|---|---|---|
| cmd/dots | ||
| testdata | ||
| .gitignore | ||
| ansi_test.go | ||
| avatar.png | ||
| braille.go | ||
| braille_test.go | ||
| color.go | ||
| color_test.go | ||
| dimensions_test.go | ||
| dots.png | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| quantize.go | ||
| README.md | ||
dots
Convert images to braille art in the terminal with ANSI colors.
$ dots -w 40 testdata/rainbow_gradient.png
$ go run ./cmd/dots -w 80 -threshold 115 avatar.jpeg
Install
go install github.com/imjasonh/dots/cmd/dots@latest
CLI Usage
# Auto-fit to terminal, maintain aspect ratio
dots image.png
# Specify width (height calculated from aspect ratio)
dots -w 80 image.png
# Specify both dimensions
dots -w 80 -h 40 image.png
# Add background color
dots -background ff0000 image.png
Library Usage
import "github.com/imjasonh/dots"
img, _ := loadImage("photo.png")
lines := dots.Convert(img, dots.Options{
Width: 80,
Height: 40,
})
for _, line := range lines {
fmt.Println(line)
}