1
0
Fork 0
mirror of https://github.com/imjasonh/dots synced 2026-07-07 00:22:55 +00:00
No description
Find a file
Jason Hall 9419fd6aac
Merge pull request #1 from imjasonh/cursor/-bc-e00bca0f-ab44-48d9-9510-1f4d4047f6c5-a218
chore: update Go dependencies and fix tests in NO_COLOR environments
2026-05-21 14:07:24 -04:00
cmd/dots golangci-lint, remove image creation from tests 2025-11-14 16:18:30 -05:00
testdata simplify 2025-11-14 10:40:40 -05:00
.gitignore add -frame 2025-11-14 14:22:20 -05:00
ansi_test.go test: unset NO_COLOR in TestMain for ANSI color tests 2026-05-21 17:00:48 +00:00
avatar.png more examples 2025-11-14 11:06:17 -05:00
braille.go add -frame 2025-11-14 14:22:20 -05:00
braille_test.go golangci-lint, remove image creation from tests 2025-11-14 16:18:30 -05:00
color.go simplify 2025-11-14 10:40:40 -05:00
color_test.go fix eee bug 2025-11-14 16:25:47 -05:00
dimensions_test.go simplify 2025-11-14 10:40:40 -05:00
dots.png update readme 2025-11-14 10:47:03 -05:00
go.mod chore: update Go dependencies 2026-05-21 17:00:43 +00:00
go.sum chore: update Go dependencies 2026-05-21 17:00:43 +00:00
LICENSE simplify 2025-11-14 10:40:40 -05:00
quantize.go fix eee bug 2025-11-14 16:25:47 -05:00
README.md more examples 2025-11-14 11:06:17 -05:00

dots

Go Reference

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)
}