asciifx

command module
v0.0.0-...-61b0527 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 8 Imported by: 0

README

asciifx

An image to text-art command-line and library converter!

Preview Image

Use Cases
  1. Displaying images on a headless server (you only have access to the terminal prompt)
  2. Creating banners / comment arts for your projects and documentations
  3. Spam others with funny outputs you just created
  4. Just have fun with it
How to use

You can use asciifx as a library in your already existing Go projects or as a command-line application.

Library way
  1. Import the asciifx headers in your main code:
import (
  "github.com/brylleee/asciifx/asciifx"
  "github.com/brylleee/asciifx/asciify"
  "github.com/brylleee/asciifx/dithering"
  "github.com/brylleee/asciifx/downsampler"
)
  1. You can then create an asciifx object, load any image, then convert it
func main() {
  // ...
  asciifxobj := &asciifx.AsciiFx{}             // create asciifx object
  err = asciifxobj.Load("images/maki.png")     // load any image
  if err != nil {                              // ensure no errors
    log.Fatal(err)
  }

  ditheringMethod = dithering.UseFloydSteinberg()             // Choose dithering algorithm
  downsamplerMethod = downsampler.UseNearestNeighbor(5)       // Choose downsampling algorithm
  asciifyMethod = asciify.UseBraille()                        // Choose output style

  result := asciifxobj.Convert(ditheringMethod, downsamplerMethod, asciifyMethod)      // Convert and store result

  // Looping over every lines in the result
  for _, v := range result {
    fmt.Println(v)
  }
}
Command-line interface

You can download the binary (if I haven't provided one yet, build it yourself please)
You must have Golang installed in your system to build it.

  1. Clone the repository
git clone https://github.com/brylleee/asciifx && cd asciifx
  1. Simply build the main source code
go build main.go && ./main
Dedicated website

I am hosting a website that you can use to convert any images to asciifx conveniently.
You can also see examples there.
Please check it out here!


Documentation

Link to more documentation is here.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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