Documentation
¶
Index ¶
- Variables
- func FromFile(path string, opts Options) (string, error)
- func FromImage(img image.Image, opts Options) (string, error)
- func FromReader(r io.Reader, opts Options) (string, error)
- func FromURL(url string, opts Options) (string, error)
- func GetCharset(name string) string
- func ListCharsets() []string
- func LoadImageFile(path string) (image.Image, error)
- func LoadImageURL(url string) (image.Image, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var CharSets = map[string]string{
"standard": " .:-=+*#%@",
"simple": " .*#",
"binary": " █",
"ascii": " .,:;i1tfLCG08@",
"detailed": " .'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$",
"blocks": " ░▒▓█",
"shade": " ░▒▓█▄▀▌▐",
"braille": " ⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿",
"box": " ─│┌┐└┘├┤┬┴┼━┃┏┓┗┛┣┫┳┻╋╔╗╚╝╠╣╦╩╬░▒▓█",
"geometric": " ◦◌○◎●◐◑◒◓◔◕◖◗◘◙◚◛◜◝◞◟◠◡◢◣◤◥◦◧◨◩◪◫◬◭◮◯",
"shapes": " ·∘○◌◎●◐◑▪▫◻◼◽◾▢▣▤▥▦▧▨▩■□▬▭▮▯",
"math": " ·∙∘∴∵∶∷∸∹∺∻∼∽∾∿≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥",
"stars": " ·✦✧★☆✡✢✣✤✥✦✧✩✪✫✬✭✮✯✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃❄❅❆❇❈❉❊❋",
"dingbats": " ·•‣⁃⁌⁍∎∗※⁂⁎⁑⁕❖❗❘❙❚❛❜❝❞❟❠❡❢❣❤❥❦❧",
"arrows": " →↗↑↖←↙↓↘↔↕↯⇐⇑⇒⇓⇔⇕⇖⇗⇘⇙⇚⇛⇜⇝⇞⇟⇠⇡⇢⇣⇤⇥⇦⇧⇨⇩⇪",
"music": " ♩♪♫♬♭♮♯𝄞𝄢𝄪𝄫",
"symbols": " ·‥…※†‡•‣⁂⁃⁎⁑⁕♠♡♢♣♤♥♦♧♨♩♪♫♬☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏",
"ultra": " .'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$░▒▓█▀▄▌▐●○◐◑◒◓■□▪▫◻◼★☆✦✧",
"retro": " ·:;+*%#@█▓▒░",
"dots": " ·∘○◌◎●",
"elegant": " ·‥…∴∵∶∷⁘⁙⁚⁛⁜⁝⁞",
"dense": " 一二三亖卅卌╳╬╫╪╩╨╧╦╥╤╣╢╡╠╟╞╝╜╛╚╙╘╗╖╕╔╓╒║═",
"hatch": " /\\|─│┌┐└┘├┤┬┴┼╱╲╳",
"stipple": " ⠀⠁⠂⠄⠈⠐⠠⡀⢀⣀⣠⣤⣴⣶⣷⣿",
"dots_braille": " ⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿",
}
Character sets for different styles - leveraging full Unicode
Functions ¶
func FromReader ¶
FromReader converts an image from io.Reader to ASCII art
func LoadImageFile ¶
LoadImageFile loads an image from a file path
Types ¶
type Options ¶
type Options struct {
Width int // Target width in characters (0 = auto)
Height int // Target height in characters (0 = auto based on width)
Charset string // Characters to use (dark to light)
Invert bool // Invert brightness
EdgeDetect bool // Use edge detection
Color bool // Preserve colors (ANSI)
Dither bool // Apply dithering
}
Options for ASCII conversion
Click to show internal directories.
Click to hide internal directories.