asciitor

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

README

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMTMMNNMTMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNg  gNNg  gNNM  MNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNMMMMMMMNNNNNNMMMMMMNNNNNMMMMMMNNMMMMNNMMMMNNM  MMMMNNNNNMMMMMNNNNNNMMMMMMNNNN
NNNN  y    MNNM   yy mNNNM    y mNNM  NNNK  NNNM   yyyNNM        MNNNm   y  NNNN
NNNNMMMMM  mNNm  MMMNNNNM  mNNNNNNNM  NNNK  NNNM  MNNNNN   NNNNm  MNNm  NNNNNNNN
NNM   ggg  mNNNNgy   MNNM  MNNNNNNNM  NNNK  NNNM  MNNNNN  MNNNNM  MNNm  NNNNNNNN
NNK  MMMM  mNNMMMMMM  NNN   MMMMMNNM  NNNK  NNNN  MMMMNNm  MMMM   NNNm  NNNNNNNN
NNNgy     ygNNy     ggNNNNgg    yNNM  NNNK  NNNNNy    gNNNgy   ygNNNNm  NNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

installation

pre-requirements

build (cli)

make flags      # generate compile_flags for freetype
make build:cli  # build binary to build/asciitor

or run directly:

make run:cli

options (cli)

structure

asciitor [INPUT] ...flags
  • input - input writer (file or pipe), default to stdin
  • --output -o - output writer (file or pipe), default to stdout
  • --width -w - output width (px/characters/tw/original)
  • --charset -c - charset preset (alphanumeric/ascii/braille) or file
  • --height -h - output height (px/lines/th/original)
  • --font -f - font from the bundled (mono/symbols/inter) or font file
  • --face - font face index
  • --font-size -s - font size in pixels
  • --block-size -b - block size (bigger values better represent colors but lack details)
  • --fill - fill output with no respect to original proportions
  • --inverse - inverse image colors

todo

  • basic library functionality
  • cli tool
  • examples
  • text recognition
  • better README
  • xkcd to ascii tool (more examples)
  • frontend

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asciitor

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

func NewAsciitor

func NewAsciitor(options AsciitorOptions) (*Asciitor, error)

func (*Asciitor) Prepare

func (a *Asciitor) Prepare() error

func (*Asciitor) Render

func (a *Asciitor) Render(img image.Image, options RenderOptions) ([][]rune, error)

func (*Asciitor) SetBlockSize

func (a *Asciitor) SetBlockSize(size int) error

func (*Asciitor) SetCharset

func (a *Asciitor) SetCharset(charset []rune) error

func (*Asciitor) SetFace

func (a *Asciitor) SetFace(face *font.Face) error

func (*Asciitor) SetFontSize

func (a *Asciitor) SetFontSize(size int) error

type AsciitorOptions

type AsciitorOptions struct {
	Face      *font.Face
	FontSize  int
	Charset   []rune
	BlockSize int
}

type RenderOptions

type RenderOptions struct {
	OutputSize sizing.OutputSize

	KeepProportions bool
	Inverse         bool
}

Directories

Path Synopsis
cmd
asciitor command
internal

Jump to

Keyboard shortcuts

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