LinuxCommandLibrary

asciiart

Convert images to ASCII art

TLDR

Read an image from a file and print in ASCII

$ asciiart [path/to/image.jpg]
copy

Read an image from a URL and print in ASCII
$ asciiart [www.example.com/image.jpg]
copy

Choose the output width (default is 100)
$ asciiart [[-w|--width]] [50] [path/to/image.jpg]
copy

Colorize the ASCII output
$ asciiart [[-c|--color]] [path/to/image.jpg]
copy

Choose the output format (default format is text)
$ asciiart [[-f|--format]] [text|html] [path/to/image.jpg]
copy

Invert the character map
$ asciiart [[-i|--invert-chars]] [path/to/image.jpg]
copy

SYNOPSIS

asciiart [options] [string]

PARAMETERS

-f, --font FILENAME
    Specify font file (default: standard)

-w, --width NUM
    Set maximum output width

-c, --center
    Center justify the output

-l, --left
    Left justify (default)

-r, --right
    Right justify

-s, --smush
    Enable character smushing for compact output

-k, --kerning
    Adjust letter spacing

DESCRIPTION

asciiart is a utility for transforming plain text into large, stylized ASCII art using various fonts and layouts. Primarily used for creating eye-catching terminal banners, logos, or decorative outputs in scripts and shell prompts.

It reads input text from arguments or stdin, applies selected fonts (predefined or custom), and outputs fixed-width ASCII representations. Supports features like kerning, smushing, and full-width justification.

Not a core Linux command; often installed via packages (e.g., in some distros as "ascii-art" or similar scripts). Ideal for log headers, MOTD customizations, or fun terminal effects. Limitations include monospace font dependency and lack of color (pair with lolcat).

Example: asciiart -f big "Hello World" renders oversized text.

CAVEATS

Requires monospace terminal; not installed by default (use apt install figlet for similar); custom fonts need ~/.asciiart/fonts/ directory.

EXAMPLE USAGE

echo 'Linux' | asciiart -f slant -w 80
Produces slanted, 80-column wide ASCII 'Linux'.

FONT INSTALLATION

Download fonts to /usr/share/figlet/ or equivalent; list with asciiart -I.

HISTORY

Inspired by 1970s banner utility; modern tools like figlet (1996) evolved into variants including asciiart scripts in Perl/Python since early 2000s for enhanced fonts.

SEE ALSO

figlet(1), toilet(1), banner(1), cowsay(1), jp2a(1)

Copied to clipboard