dotmatrix

package module
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 12 Imported by: 8

README

Dotmatrix

Go Reference

Convert images to Unicode braille art for terminal display.

Input Output
Input image Terminal output

Features

  • Encode JPEG, PNG, GIF, and BMP images as braille Unicode characters
  • Animated GIF support with proper frame timing and disposal methods
  • MP4 video playback with H.264 decoding (requires FFmpeg)
  • Embedded subtitle rendering for MP4 files (mov_text format)
  • Native webcam capture on macOS (AVFoundation)
  • Image adjustments: gamma, brightness, contrast, sharpening
  • Floyd-Steinberg dithering for grayscale preservation
  • Automatic scaling to fit terminal dimensions

Installation

Pre-built Binary
go install github.com/kevin-cantwell/dotmatrix/cmd/dotmatrix@latest
Building with MP4 Support

MP4 playback requires FFmpeg development libraries and CGO.

macOS:

brew install ffmpeg
PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig" CGO_ENABLED=1 go build -o dotmatrix ./cmd/dotmatrix
codesign -s - dotmatrix  # Ad-hoc sign to prevent "Killed: 9" errors

Ubuntu/Debian:

sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
CGO_ENABLED=1 go install github.com/kevin-cantwell/dotmatrix/cmd/dotmatrix@latest

Usage

Command Line
# From file
dotmatrix image.png

# From URL
dotmatrix https://example.com/image.jpg

# From stdin
curl -s https://example.com/image.jpg | dotmatrix

# With options
dotmatrix --invert --sharpen 50 image.png

# Play MP4 video (subtitles are displayed if embedded)
dotmatrix video.mp4

# Play MP4 at specific framerate
dotmatrix --fps 15 video.mp4

# Capture from webcam (macOS only)
dotmatrix --webcam

# Webcam with options
dotmatrix --webcam --invert --fps 15
As a Library
package main

import (
    "image"
    "os"

    "github.com/kevin-cantwell/dotmatrix"
)

func main() {
    img, _, _ := image.Decode(os.Stdin)
    dotmatrix.Print(os.Stdout, img)
}

Options

Flag Description
--invert, -i Invert colors (for dark backgrounds)
--gamma, -g Adjust gamma: negative darkens, positive lightens
--brightness, -b Adjust brightness (-100 to 100)
--contrast, -c Adjust contrast (-100 to 100)
--sharpen, -s Sharpen image
--mirror, -m Flip image horizontally
--mono Disable Floyd-Steinberg dithering
--webcam, -w Capture from webcam (macOS only)
--framerate, --fps Set playback framerate
--mimeType, --mime Override auto-detected MIME type

Examples

Sharpened Image
dotmatrix --sharpen 100 face.jpg
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣜⢽⡺⣿⣿⣺⣿⣏⣿⣿⣿⣿⢿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣜⡞⣧⢅⢳⡙⣼⣻⡢⡺⡼⣻⢞⡯⣟⣽⢻⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣻⣯⣿⣿⣿⡿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡜⣖⢔⠕⢸⡳⡢⡱⠅⡞⣽⠱⢳⢫⡟⡞⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣱⣿⣿⣵⡿⣿⣟⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣷⢿⡽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⡿⡽⣿⢿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⢣⢫⠀⠣⠂⢘⠐⢁⢊⠠⠉⢎⢎⢣⢿⡻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⡼⡜⡾⡯⡫⢽⢽⣗⢟⣿⣿⣿⣿⣿⣿⣿⣟⡮⣟⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⡿⡭⡺⣫⣟⡷⣟⢾⢽⢿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣎⠄⢊⢂⠠⠈⠄⠂⠀⢁⢑⠁⢜⡧⡗⢡⢮⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣜⢜⢌⢊⠈⣄⢜⢿⡫⣿⣿⣿⣿⣿⣿⣿⡿⡱⣻⢟⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
Animated GIF

Animated GIFs play directly in the terminal with proper timing:

Animated GIF example

Note: Terminal refresh rates vary. The default macOS Terminal.app works well; iTerm2 may have slower refresh rates.

MP4 Subtitles

MP4 files with embedded subtitles (mov_text/tx3g format) will display subtitles overlaid at the bottom of the video. Subtitles are:

  • Automatically extracted and timed to video playback
  • Centered and wrapped to fit the terminal width
  • Rendered over the braille output while preserving surrounding pixels

How It Works

Dotmatrix uses Unicode Braille Patterns (U+2800 to U+28FF) to represent images. Each braille character encodes a 2x4 pixel grid, allowing 256 possible patterns per character.

Processing pipeline:

  1. Decode - Parse input (JPEG, PNG, GIF, BMP, or MP4 video)
  2. Filter - Apply brightness, contrast, gamma, sharpening adjustments
  3. Scale - Resize to fit terminal dimensions (2 pixels per column, 4 pixels per row)
  4. Dither - Convert to monochrome using Floyd-Steinberg diffusion
  5. Encode - Map each 2x4 pixel block to a braille character
  6. Render - Output braille characters with newlines (for video, frames are rendered in sequence)

The Floyd-Steinberg dithering algorithm distributes quantization errors to neighboring pixels, preserving the appearance of grayscale gradients in the monochrome output.

License

MIT

Documentation

Overview

Package dotmatrix encodes images in a "dot matrix" pattern using braille unicode characters. Images are first converted to monochrome, then each 2x4 pixel block is coded to an 8-dot braille character. In this fashion, an image's entire pixel set can be mapped, one-by-one, to either a "filled" or "unfilled" braille dot. The resulting braille symbols are arranged as lines of text to form a representation of the original image. The encoded image is lossy in the sense that color information is reduced to monochrome with diffusion, but otherwise the resulting text-based image is pixel perfect. In other words, if a pure monochrome image is used as input, there will be no loss of information.

https://en.wikipedia.org/wiki/Braille_Patterns⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⡳⡧⡓⡝⣟⢿⢼⣿⠳⣿⣿⣿⢿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣼⣷⢿⣿⣿⢿⣻⣿⣺⣿⣿⣿⣿⣿⣿⣿⣿⣿⣫⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣎⠷⡄⠣⠣⣺⡻⠨⡧⢛⣯⢟⢾⡵⣻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣻⠽⣫⣾⢿⢾⣟⣺⣻⣿⣿⣿⣿⣿⣿⣿⣾⣽⡝⣽⢻⡻⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿
⣿⣿⣿⣿⢟⣿⢿⣿⢿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡱⡱⡁⠈⡯⠘⢜⠘⢸⠈⡣⣳⢫⠹⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣕⡝⡻⣺⡾⢿⢮⡗⣟⣿⣿⣿⣿⣿⣿⣟⣗⢻⢝⣳⣏⣾⣿⣿⣿⣿⣽⣽⣟⣿⣿
⣿⣿⣿⢑⣝⢯⡯⣾⢻⣻⣽⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣅⠕⠀⠡⠀⠁⠌⠐⠈⠄⢣⠊⣾⡏⡟⢻⣿⣿⣿⣿⣿⣿⣿⣿⣯⡆⢍⠏⢓⠁⠃⣻⣵⢻⣿⣿⣿⣿⣿⣿⢞⢪⢾⣿⢫⣾⣿⣿⣿⣿⣷⣿⣿⣿⣿
⣿⣿⠣⢁⠪⡳⡫⣮⣱⢱⠹⣳⢻⡻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣨⠀⠀⠀⠁⠀⠀⠅⠅⢏⡻⡨⠪⢨⠻⣿⣿⣿⣿⣿⣿⣿⣿⣔⠈⢀⠔⠘⠈⡃⣙⣿⣿⣿⣿⣿⣿⣕⡘⢭⢎⡷⣟⣾⣾⣿⣿⡻⣵⢿⣾⣿
⣿⢇⡊⡄⡏⢉⡫⣫⢝⢮⠺⣔⠭⡚⢐⠜⢻⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠡⠃⠐⠈⠀⠁⠄⠹⢿⣿⣿⣿⣿⣿⣿⣷⡁⢂⠁⠀⢀⠐⠅⠚⣿⣿⣿⣿⣿⣿⠂⠢⡳⣻⣺⣿⢿⣿⣿⣟⣳⢻⣵⣿
⣿⡇⣫⠂⡀⠃⠀⠅⡝⣒⠳⠌⠕⠁⠂⠈⠀⠈⠈⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢘⣿⣿⣿⣿⣿⣿⣿⣮⠀⠀⠀⠀⠀⠀⢍⠹⣿⣿⣿⣿⣿⢅⢪⡽⡽⣹⣜⣽⣿⣿⡯⢺⢫⣻⣿
⣿⣾⣵⣶⣷⣬⣅⠅⠌⠘⡐⣈⠁⡀⠄⠀⠀⠀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠥⢐⣽⣿⣿⣿⣿⡣⠈⡩⣓⣵⡻⢽⣿⣿⢗⣕⣗⢷⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣭⣥⡉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡄⠀⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣷⡆⠀⠀⠀⠀⠀⠈⢽⣿⣿⣿⢿⡕⠈⠴⠵⢵⢶⣿⣿⣿⡗⣪⣼⢞⣷
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡄⠀⠀⠀⠀⠀⠀⠈⢹⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⢼⣿⣿⣿⣷⠕⠈⠠⢦⢵⣻⣿⣿⣿⣞⣝⢿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠨⣿⣿⣿⣿⠡⠀⡈⠀⠩⣿⣿⣿⣟⢇⠃⣗⣿⣟
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠈⢻⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠈⣿⣿⣿⣿⠀⠀⠀⠀⠑⣿⣿⣿⣿⡥⠠⣽⣿⣿
⣿⣿⢯⢿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣄⡀⠀⠀⠀⠀⠀⠀⠉⠻⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠈⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⣿⣿⣿⣷⠀⠀⠀⠀⢱⣿⣿⣿⣟⠎⣪⣿⣿⣪
⣿⣿⡯⡻⡙⡋⠉⠪⠁⠀⠀⠀⠀⠀⠀⠉⠉⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⣿⣿⣿⡿⠀⠀⠀⠀⢿⣿⣿⣿⡫⢢⣿⣿⣯⢷
⣿⡿⣯⡪⡂⡄⢄⢁⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠈⠻⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⢹⣿⣿⣿⣿⠀⠀⠀⠀⠀⣿⣿⣿⡇⠀⠀⠀⣐⣾⣿⡿⡧⢑⢶⣿⡟⣳⣿
⠀⠈⢳⣳⣽⣿⣾⣶⣿⣯⡶⢴⣴⣤⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠿⣿⣿⣿⣿⣿⣿⣷⣤⡀⠀⠀⠀⠀⠉⢻⣿⣿⣿⣿⣧⠀⠀⠀⠀⠸⣿⣿⣿⣿⠀⠀⠀⠀⢀⣿⣿⣿⠇⠀⠀⠀⣽⣿⡿⡏⡐⢸⣿⣟⢳⣷⣿
⣤⣶⣽⣟⣿⣿⣿⣿⣿⢕⣽⢽⣺⢿⣿⣿⣿⣶⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠙⠛⢿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠻⣿⣿⣿⣿⣧⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⢰⣿⣿⣿⠁⠀⠀⢠⣿⣿⠽⠨⣮⣾⣿⣣⣿⣾⠟
⣷⣿⣿⣿⣿⣿⣿⣟⢎⠧⡫⣻⢟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣤⡀⠀⠀⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠘⢿⣿⣿⣿⡄⠀⠀⠀⢹⣿⣿⣿⠀⠀⠀⠀⣼⣿⣿⡏⠀⠀⠀⣼⣿⠇⠀⣼⣿⡿⣪⣿⣿⠋⢀
⣿⣿⣿⣿⣿⣿⣿⠁⠁⠀⠀⠀⠀⠉⠉⠉⠛⠛⠻⢿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣄⡀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣦⡀⠀⠀⠈⢻⣿⣿⣷⡀⠀⠀⠈⣿⣿⣯⠀⠀⠀⢀⣿⣿⡿⠁⠀⠀⢰⣿⡟⠀⢰⣿⡟⢝⢸⡟⠁⣠⣾
⣿⣿⠏⠑⢽⡻⢑⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⢿⣿⣿⣿⣿⣿⣷⣦⣤⡀⠀⠀⠀⠈⠙⣿⣿⣿⣷⣄⠀⠀⠀⠻⣿⣿⣧⠀⠀⠀⢿⣿⣷⠀⠀⠀⢸⣿⣿⠃⠀⠀⢀⣿⣿⠁⠀⣾⠉⢓⠠⡿⠅⣴⣿⣿
⣿⣯⠀⢈⠕⡌⠆⠀⣠⣠⣤⣤⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⢿⣿⣿⣿⣿⣷⣤⡀⠀⠀⠀⠙⢿⣿⣿⣦⡀⠀⠀⠹⣿⣿⠀⠀⠀⢹⣿⣿⠀⠀⠀⢸⣿⡿⠀⠀⠀⣼⣿⠃⠀⣸⠃⠀⠪⣾⡫⣲⣿⣿⣿
⣿⠁⠀⠀⢕⢨⣺⣽⢝⡮⡷⡵⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠿⣿⣿⣿⣶⣤⠀⠀⠈⠙⣿⣿⣷⣄⠀⠀⠻⣿⣇⠀⠀⢸⣿⣿⠀⠀⠀⣾⣿⠃⠀⠀⣼⣿⠃⠀⣼⠏⠀⢠⣿⣾⣿⣿⣿⣿⣿
⡿⠀⠀⢈⣦⣿⣿⡯⣽⣺⢝⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⣤⣀⡀⠀⠀⠀⠀⠀⠀⠉⠛⠻⢿⣿⣦⣀⠀⠈⠛⣿⣿⣦⡀⠀⠙⣿⡆⠀⠘⣿⣿⠀⠀⢐⣿⡟⠀⢀⣔⠟⠃⢀⡼⠋⠀⢀⣾⣿⣿⢿⣿⣿⠟⠁
⣿⠠⢲⣻⣽⣿⣿⡝⠚⠊⠓⠛⠛⠛⠛⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⢿⢿⣿⣿⣿⣶⣶⣤⣤⣀⠀⠀⠀⠀⠉⠛⠻⢷⣤⡀⠈⠙⢿⣷⣦⡀⠘⢿⡄⠀⣹⣿⣀⣀⣿⡋⢀⣠⠾⠋⣀⡴⠋⠁⠀⢠⣾⣿⠋⠃⠻⠛⠁⠀⠀
⣿⣴⣾⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠐⢐⣶⣶⣾⣾⢾⣶⣶⣶⣶⣶⣦⣭⣍⠛⢛⠛⠿⠿⣿⣷⣶⣦⣄⣀⠀⠀⠉⠛⠶⣦⢤⣽⣿⣷⣶⣾⣿⣿⣿⣿⣿⡿⢿⣿⣿⣿⡒⠚⠉⠁⢀⣤⣾⣿⣿⠓⠀⢰⠆⠀⠀⠀⠀
⣿⣿⣿⣿⣿⢟⠅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⣛⣿⠛⠃⠈⠻⣛⠛⠛⣻⠋⠛⣿⣿⣶⣬⡠⠀⠀⠀⠀⠉⠉⠙⠛⠛⠒⠲⠒⢒⣫⣵⢿⣿⠋⠙⠿⣋⣋⣻⠛⠁⠁⠛⣻⣯⣶⣶⣶⣾⣿⣿⠿⠛⠁⠀⢀⡺⡧⠀⣠⣴⣾
⣿⣿⣏⠁⠁⡃⠆⠀⠀⠀⢀⣠⣠⣤⣤⣶⣶⣿⣿⣿⣦⣄⣀⠈⠉⠉⠀⢀⣀⢻⣾⣿⣿⣿⣷⣦⣤⣤⣤⣤⣤⣤⣤⣤⣤⠖⠋⠉⣠⣟⠻⣱⣤⣤⣤⣅⣀⣤⣤⣶⣿⠿⠟⠛⠋⠉⠉⠉⠀⠀⠀⠀⢠⣞⣮⣿⣿⣿⣿⣿
⣿⣿⣿⣦⡀⠀⠁⢠⢔⢾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠋⠈⠀⠀⠈⠙⠙⠋⠙⠉⠉⠉⠉⠉⠁⣤⣶⠟⠋⣡⠔⣩⢺⢿⢻⠯⡙⠓⠶⣤⣤⣤⣤⣤⣤⣶⣶⣶⣶⣶⣶⣾⣿⢵⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣶⣷⣮⢇⢯⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠛⠛⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⠛⠁⡴⠊⣡⠖⡅⣨⠏⡜⡄⠹⣶⣤⡀⠉⠉⠉⠋⠛⠛⠛⠛⠛⠛⠛⠋⠂⢸⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡧⣫⢻⣿⣿⣿⠿⠛⠛⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣤⣴⣶⣶⣶⣾⣿⡿⠛⠁⣠⡞⢀⡴⠁⡌⢠⡏⡎⢇⢻⡄⠉⠻⣿⣿⣶⣦⣤⣤⣤⣀⣀⡀⡀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡪⠟⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣶⣿⣿⣿⣿⣿⣿⠿⠛⠛⠉⠁⠀⢠⣴⠛⢡⣾⠃⣼⠁⣼⡇⢧⠸⣤⠹⣦⡀⠀⠉⠛⠻⢿⣿⣿⣿⣿⣿⣿⣿⡪⣪⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⠅⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⣴⣾⣿⣿⣿⣿⠿⠛⠉⠉⠁⠀⠀⠀⠀⠀⣠⣶⡿⠃⣠⣿⠃⢠⡏⠀⣿⡇⢹⡇⠹⣧⠙⢿⣦⣄⠀⠀⠀⠈⠙⠛⠻⢿⣿⡿⡱⣽⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⣀⣠⣴⣶⣿⣿⣿⣿⣿⣿⡿⠛⠉⠁⠀⠀⠀⠀⠀⠀⢀⣠⣶⣿⣿⠏⠀⢰⣿⡏⠀⣼⠁⠀⣿⡇⠈⣿⠀⠹⣦⠈⠛⣿⣷⣦⣄⠀⠀⠀⠀⠀⠀⠉⠀⣸⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⢀⣠⣶⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⠟⠀⠀⢠⣾⡟⠀⢰⡟⠀⠀⣿⡇⠀⢻⣇⠀⠹⣷⡀⠈⠛⢿⣿⣿⣦⣄⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣶⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⡿⠛⠁⠀⠀⢠⣿⣿⠇⠀⢸⡇⠀⠐⣿⣷⠀⢸⣿⡆⠀⢹⣿⣄⠀⠈⠙⢿⣿⣿⣿⣶⣶⡴⣺⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣽⠿⠋⠀⠀⠀⢀⣴⣿⣿⡿⠀⠀⣸⡇⠀⢸⣿⣿⠀⠀⣿⣷⠀⠀⢿⣿⣦⠀⠀⠀⠙⠻⣿⣿⣿⠕⣹⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⠀⠀⠀⠀⠀⠀⣠⣴⣾⣿⣿⣿⡿⣫⣑⣦⣄⠀⠀⣠⣼⣿⣿⣟⣥⣴⣴⠟⠁⠀⢸⣿⣿⠀⠀⢹⣿⣦⠀⠈⢻⣿⣷⣄⠀⠀⠀⠈⠉⠁⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡟⠋⠀⠀⠑⠁⢙⣶⣾⣿⣿⠟⠉⠉⢡⣿⣿⠀⠀⠀⢸⣿⣿⡄⠀⠀⣿⣿⣇⠀⠈⠻⣿⣿⣷⣄⣀⢀⠀⡀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⣰⣾⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⠃⠀⠀⠀⢸⣿⣿⠀⠀⠀⠘⣿⣿⣷⡀⠀⢸⣿⣿⡄⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⢠⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠋⠀⠀⠀⠀⣾⣿⣿⠀⠀⠀⠀⣿⣿⣿⣧⠀⠀⢻⣿⣿⡄⠀⠀⠈⠛⠿⢿⠿⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⣶⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⣿⡟⠀⠀⠀⠀⢠⣿⣿⡿⠀⠀⠀⠀⣿⣿⣿⣿⡄⠀⠀⢻⣿⣷⡄⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣾⣿⣿⣿⣿⣿⡿⠉⠀⠀⢀⡀⡀⣀⣠⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⣾⣿⣿⡯⠀⠀⠀⠀⣿⣿⣿⣿⣧⠀⠀⠈⣿⣿⣿⣦⡀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠉⠙⠛⣻⣿⣿⣿⣿⣿⠛⠓⠒⠒⠒⢳⣿⣿⣿⡟⠒⠒⠓⠛⣿⣿⣿⣿⣿⡄⠀⠀⠘⣿⣿⣿⣿⠗⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡗⠈⢻⣿⠏⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⠀⠀⠀⠀⢸⣿⣿⣿⣿⣷⠀⠀⠀⠘⣿⡿⠉⠀⢽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣽⣿⡣⠀⠈⡋⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⣧⠀⠀⠀⣸⡅⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣹⣾⣿⠂⠀⢐⠨⠢⡀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⡿⠁⠣⠲⠶⡲⢖⣾⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣇⣠⣼⣿⣷⡀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏⢏⡾⣟⣿⠠⠀⠄⢂⠑⠔⡄⠀⢠⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡦⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡫⠣⡱⡵⣻⣿⣯⢃⠀⢐⠠⠈⡊⢼⣶⣾⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠈⢻⡿⠛⣿⣿⣿⣿⣿⣿⣿⣿⡥⡀⠀⠀⠑⠹⢿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡿⡟⠝⡑⢌⢪⢪⢞⣯⡷⡯⡂⠄⠀⡂⠐⠨⡸⣿⣿⣿⣿⣿⣿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⢀⠌⠀⠀⠘⢹⣿⣿⣿⣿⣿⣿⣿⣧⡂⠀⠀⠀⠁⠩⠻⣻⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⢟⠫⡊⠌⢌⢐⢅⢎⢮⣻⣺⢽⢝⠔⢀⠡⠀⠌⡐⢼⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠠⢐⠁⠌⠠⠀⠀⠀⠙⢻⣿⣿⣿⣿⣿⣿⣾⡢⡀⠠⠐⢀⠡⠈⠝⡻⣿⣿⣿
⣿⡿⡟⡝⢌⠢⡑⠌⢌⠢⡂⡇⣗⢽⣺⡽⣽⢱⢁⠂⠄⡁⠂⠠⢱⣿⣿⣿⣿⣿⣿⣷⣤⡀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣶⡌⢈⠠⠈⠀⠂⠀⠀⠀⠀⠀⠛⢿⣿⣿⣿⣿⣿⣷⡪⡢⢈⠄⠂⢅⠑⢌⠢⠫⢿
⡫⡪⠪⡨⠢⡑⠌⢜⢐⢑⢌⢮⡺⣝⣗⣟⢮⢣⠂⠌⡠⠀⠡⠈⠠⣻⣿⣿⣿⣿⣿⣿⣿⣿⢑⢲⡰⡤⡤⣄⢼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⡀⠀⢀⠈⡀⠂⠀⠈⢀⠀⠀⠈⠻⢿⣿⣿⣿⣿⣯⣞⢔⠌⢌⢐⢈⠢⢑⠍⡪
⢸⠨⡊⡢⡑⢌⢊⠢⡑⡅⢇⠧⡯⣳⢯⣞⡝⡆⢅⠅⡂⠌⡐⢈⠀⢝⣿⣿⣿⣿⣿⣿⣿⣿⢜⠔⢕⢝⢜⢜⢜⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⡐⠀⠄⢀⠈⠄⡁⠄⠠⠀⠀⠈⡈⢏⢿⣿⣿⣿⣯⣷⢍⢆⠢⡂⠌⡂⡑⢌
⡘⢌⠢⡑⢌⢢⠡⡃⢕⢸⢨⡫⣞⡽⣳⢵⢝⢜⢐⢐⢀⢂⠐⠄⢂⢐⢽⣿⣿⣿⣿⣿⣿⣿⡇⡕⢕⢌⢂⠕⡨⢚⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡡⠐⢀⠀⢂⠀⡂⠐⡀⠁⠄⢐⢀⠣⡫⣻⣿⣿⣿⣟⣎⡇⡆⢅⠢⡈⡢
⢸⠨⡊⡌⢆⢕⢑⠜⡌⡎⢮⢮⡳⣝⣗⣝⢮⢊⡂⡂⡢⠐⡈⢐⢀⠂⢽⣿⣿⣿⣿⣿⣿⣿⣯⡪⡪⡢⡑⢌⠔⡈⡺⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡅⡂⠠⠀⠂⠀⠂⠄⠅⠨⠀⠄⢂⠪⡘⡎⡯⡿⣿⣷⣻⣜⢢⠡⢂⠢
⠢⡃⡪⡨⡒⡬⡢⡣⡣⡹⣪⡳⡽⣕⢗⡎⡎⡖⡨⢂⠢⡁⡂⡂⡐⠨⡘⣿⣿⣿⣿⣿⣿⣿⣿⢮⢢⢑⠌⣂⠪⢐⠸⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡔⡅⠌⠠⠈⡐⠀⠌⠠⠁⡂⢐⠨⠐⡡⢱⢹⢽⣿⢿⣺⣜⢌⠢⡨
⢕⢕⢜⡔⣕⢕⢕⢕⢕⢝⣜⢮⢳⢕⢗⡕⡇⡕⢌⠢⡑⡐⡐⠠⠐⠡⠨⣻⣿⣿⣿⣿⣿⣿⣿⣿⡰⢐⠌⡂⠅⠅⡘⠸⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⡐⠄⠁⠄⠂⡈⠀⠅⡐⡐⠠⡁⡂⢅⢣⡫⣾⢿⣿⢾⡕⡕⡔
⡷⡯⣷⢽⡮⡷⣝⢮⢮⡣⣗⢵⢹⢪⡣⡣⡣⡊⡢⡑⢔⢐⠌⠄⠡⠁⠅⢯⣿⣿⣿⣿⣿⣿⣿⣷⡇⡂⠐⠀⡁⠅⢀⠁⠕⡻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⣕⠅⢌⠐⡀⠅⢂⠢⠨⡢⢢⢱⢱⢱⡹⡮⡿⣽⣟⣮⢷⢵
⢝⢝⢪⢫⢪⢫⢪⢫⢺⢺⢸⢪⢳⡱⡕⡕⡕⡌⡆⣊⠢⡂⡊⠨⢀⠁⡈⢎⣿⣿⣿⣿⣿⣿⣿⣿⣗⢄⠡⠀⠠⠈⢄⠐⡀⠌⢘⢝⢿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣾⡽⣦⡣⡐⡅⡢⡑⡕⡜⡎⡗⡝⡕⡝⡎⡏⢞⢜⢎⢏⢏
⡑⢅⠣⡊⡢⢑⠅⠕⢅⠣⡃⢇⢇⢇⢏⢪⠪⡊⡎⢔⢑⠔⢌⠌⠠⠐⡀⠕⣝⣿⣿⣿⣿⣿⣿⣿⣗⠅⠀⠀⠀⠌⠠⠂⠄⠠⠀⠄⠩⡫⡺⡯⣻⣝⢯⣟⢿⢽⡺⡯⣗⢯⢷⡱⡜⢌⠪⡘⡌⡪⠪⡘⢌⠢⡊⣊⢢⢑⢅⢒

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(w io.Writer, img image.Image) error

Types

type Braille

type Braille [2][4]int

Braille epresents an 8 dot braille pattern in x,y coordinates space. Eg:

+----------+
|(0,0)(1,0)|
|(0,1)(1,1)|
|(0,2)(1,2)|
|(0,3)(1,3)|
+----------+

func (Braille) Rune

func (b Braille) Rune() rune

Rune maps each point in braille to a dot identifier and calculates the corresponding unicode symbol.

+------+
|(1)(4)|
|(2)(5)|
|(3)(6)|
|(7)(8)|
+------+

See https://en.wikipedia.org/wiki/Braille_Patterns#Identifying.2C_naming_and_ordering)

func (Braille) String

func (b Braille) String() string

String returns a unicode braille character. One of:

⣿ ⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾

type BrailleFlusher

type BrailleFlusher struct{}

func (BrailleFlusher) Flush

func (BrailleFlusher) Flush(w io.Writer, img image.Image) error

type Config

type Config struct {
	Filter  Filter
	Flusher Flusher
	Drawer  draw.Drawer
	// Reset is invoked between animated frames of an image. It can be used to
	// apply custom cursor positioning.
	Reset func(w io.Writer, rows int)
}

type Filter

type Filter interface {
	Filter(image.Image) image.Image
}

Filter may alter an image in any way, including resizing it. It is applied prior to drawing the image in the dotmatrix palette.

type Flusher

type Flusher interface {
	Flush(w io.Writer, img image.Image) error
}

Flushes an image to the io.Writer. E.g. by using braille characters.

type GIFPrinter

type GIFPrinter struct {
	// contains filtered or unexported fields
}

func NewGIFPrinter

func NewGIFPrinter(w io.Writer, c *Config) *GIFPrinter

func (*GIFPrinter) Print

func (p *GIFPrinter) Print(ctx context.Context, giff *gif.GIF) error

Print animates a gif

type MP4Printer

type MP4Printer struct {
	// contains filtered or unexported fields
}

MP4Printer prints MP4 video frames as braille characters.

func NewMP4Printer

func NewMP4Printer(w io.Writer, c *Config) *MP4Printer

NewMP4Printer creates a new MP4Printer.

func (*MP4Printer) Print

func (p *MP4Printer) Print(ctx context.Context, inputPath string, fps int) error

Print plays an MP4 video from a file path. If fps is less than zero, it will use the video's native framerate. Otherwise, fps dictates how many frames per second are printed.

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(w io.Writer, c *Config) *Printer

NewPrinter provides an Printer. If drawer is nil, draw.FloydSteinberg is used.

func (*Printer) Print

func (p *Printer) Print(img image.Image) error

Print prints the image as a series of braille and line feed characters and writes to w. Braille symbols are useful for representing monochrome images because any 2x4 pixel area can be represented by one of unicode's 256 braille symbols. See: https://en.wikipedia.org/wiki/Braille_Patterns

Each pixel of the image is converted to either black or white by redrawing the image using the printer's drawer (Floyd Steinberg diffusion, by default) and a 3-color palette of black, white, and transparent. Finally, each 2x4 pixel block is printed as a braille symbol.

As an example, this output was printed from a 134px by 108px image of Saturn:

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡿⡻⡫⡫⡣⣣⢣⢇⢧⢫⢻⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡟⡟⣝⣜⠼⠼⢚⢚⢚⠓⠷⣧⣇⠧⡳⡱⣻⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡟⣏⡧⠧⠓⠍⡂⡂⠅⠌⠄⠄⠄⡁⠢⡈⣷⡹⡸⣪⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⠿⢿⢿⢿⢟⢏⡧⠗⡙⡐⡐⣌⢬⣒⣖⣼⣼⣸⢸⢐⢁⠂⡐⢰⡏⣎⢮⣾⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣾⣶⣿⢿⢻⡱⢕⠋⢅⠢⠱⢼⣾⣾⣿⣿⣿⣿⣿⣿⣿⡇⡇⠢⢁⢂⡯⡪⣪⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⠏⢎⠪⠨⡐⠔⠁⠁⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⢱⠡⡁⣢⢏⢮⣾⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⢍⢆⢃⢑⠤⠑⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡿⡱⢑⢐⢼⢱⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⢫⡱⢊⢂⢢⠢⡃⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⢟⢑⢌⢦⢫⣪⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡻⡱⡑⢅⢢⣢⣳⢱⢑⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⡑⡑⡴⡹⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⢝⠜⠨⡐⣴⣵⣿⣗⡧⡣⠢⢈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣜⢎⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡫⡱⠑⡁⣌⣮⣾⣿⣿⣿⣟⡮⡪⡪⡐⠠⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⢏⠜⠌⠄⣕⣼⣿⣿⣿⣿⣿⣿⣯⡯⣎⢖⠌⠌⠄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⢕⠕⢁⠡⣸⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⡽⡮⡪⡪⠨⡂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⢕⠕⢁⢐⢔⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢽⡱⡱⡑⡠⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⢕⠕⢁⢐⢰⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣞⢜⠔⢄⠡⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡿⡹⡰⠃⢈⠠⣢⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡮⣇⢏⢂⠢⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⢫⢒⡜⠐⠀⢢⣱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣳⢕⢕⠌⠄⡀⠀⠀⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡿⡑⣅⠗⠀⡀⣥⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⢙⠙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢮⡪⣂⣢⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⡟⡜⢌⡞⡀⣡⣾⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⢀⡠⠔⢜⣱⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⡿⡸⡘⢜⣧⣾⣿⣿⣿⣿⣿⣿⠿⢛⡡⠤⡒⢪⣑⣬⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⡇⡇⡣⣷⣿⣿⣿⣿⣿⠿⡛⡣⡋⣕⣬⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣮⣺⣿⣿⣟⣻⣩⣢⣵⣾⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿

type WebcamPrinter

type WebcamPrinter struct {
	// contains filtered or unexported fields
}

WebcamPrinter prints webcam frames as braille characters.

func NewWebcamPrinter

func NewWebcamPrinter(w io.Writer, c *Config) *WebcamPrinter

NewWebcamPrinter creates a new WebcamPrinter.

func (*WebcamPrinter) Print

func (p *WebcamPrinter) Print(ctx context.Context, fps int) error

Print captures frames from the webcam and renders them as braille. If fps is less than zero, frames are rendered as fast as they arrive. Otherwise, fps dictates how many frames per second are printed.

Directories

Path Synopsis
cmd
dotmatrix command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL