GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - psandis/unasciiclaw: Convert ASCII art to an image. CLI tool for the OpenClaw ecosystem.

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
ascii
ascii
 
 
assets
assets
 
 
images
images
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.node-version
.node-version
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
biome.json
biome.json
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
tsconfig.json
tsconfig.json
 
 
tsup.config.ts
tsup.config.ts
 
 

Repository files navigation

unasciiclaw šŸ¦€

npm

Convert ASCII art to an image.

unasciiclaw

unascii reads ASCII art text, maps each character's position in the ramp back to a brightness value, and writes a PNG, JPG, or WebP image. Each character becomes one pixel. Use --scale to upscale.

What It Does

  • converts ASCII art text to PNG, JPG, or WebP
  • grayscale by default, full color with --color for ANSI-colored input
  • three character ramps: classic, blocks, dense
  • --scale <n> to upscale each character to NxN pixels
  • automatic aspect ratio correction: terminal characters are 2x taller than wide, height is doubled by default
  • reads from a file or stdin
  • output defaults to images/<input-name>.png

Requirements

  • Node 22+

For development: pnpm

Install

unasciiclaw on npm

npm install -g unasciiclaw

Or clone and build from source:

git clone https://github.com/psandis/unasciiclaw.git
cd unasciiclaw
pnpm install
pnpm build

Quick Start

unascii ascii/cat1.txt                  # grayscale PNG to images/cat1.png
unascii ascii/cat1.txt --scale 8        # upscaled 8x, 800x640 pixels
unascii ascii/cat1.txt -o result.jpg    # JPG output
unascii ascii/cat1-color.txt --color    # full color from ANSI input

Demo

Input ASCII art (ascii/cat1.txt):

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@%%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@%%@@@%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Output: images/cat1.png - a grayscale PNG where each character is one pixel. Use --scale 8 for a visible result at 800x640.

CLI Options

unascii [input] [options]

Run unascii --help at any time to see the full option list in your terminal.

Option Short Default Description
--output <file> -o images/<name>.png Output image path. Format is inferred from the extension: .png, .jpg, .webp.
--ramp <name> -r classic Character ramp: classic, blocks, or dense. Must match the ramp that was used to produce the ASCII art, otherwise brightness values will be wrong.
--invert -i off Invert brightness mapping. Dark characters become bright pixels and vice versa. Use if the ASCII art was produced with --invert.
--color -c off Input contains ANSI 24-bit color codes. Each character's RGB values are extracted from the escape sequence and written as a color pixel instead of a grayscale value.
--scale <number> -s 1 Upscale each character to NxN pixels. --scale 8 turns a 100-char wide input into an 800px wide image.
--no-fix-aspect off Disable automatic 2x height stretch. By default height is doubled to correct for terminal character aspect ratio: characters are approximately twice as tall as wide, so a square image rendered as ASCII art appears squashed without this correction.
--version -V Print the version number and exit.
--help -h Show all available options and exit.

Output Formats

Format Extension Notes
PNG .png Lossless. Default. Best for pixel-accurate output, no quality loss.
JPG .jpg, .jpeg Lossy. Smaller file size, introduces compression artifacts.
WebP .webp Lossy or lossless depending on settings. Smaller than PNG, better quality than JPG at the same size.

For ASCII art with sharp pixel edges, PNG is recommended. JPG and WebP are fine for sharing or display where file size matters.

Color Mode

When the input contains ANSI 24-bit color escape codes (\x1b[38;2;R;G;Bm), pass --color to extract the original RGB value from each character and write a full color image.

Without --color, input is treated as plain text and the output is grayscale.

Ramps

Ramp Characters Best for
classic @%#*+=-:. general use, photos
blocks ā–ˆā–“ā–’ā–‘ bold, high contrast
dense full printable ASCII set maximum brightness levels

Dark characters (@, %, #) map to low pixel values. Light characters (., space) map to high pixel values. The ramp must match what was used to produce the ASCII art.

Scaling

Each character in the input becomes exactly one pixel. Without --scale a 100-char wide input produces a 100px wide image.

Command Input width Output width
unascii art.txt 100 chars 100px
unascii art.txt --scale 4 100 chars 400px
unascii art.txt --scale 8 100 chars 800px

Limitations

The conversion is lossy. ASCII art typically has 10-90 brightness levels depending on the ramp, no sub-character detail, and reduced resolution. The output is a low-resolution, quantized representation, not a restoration.

File Structure

unasciiclaw/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts              # CLI entry point
│   ā”œā”€ā”€ convert.ts            # ASCII-to-image core
│   └── ramps.ts              # character ramp definitions
ā”œā”€ā”€ tests/
│   ā”œā”€ā”€ images/               # test fixtures
│   └── convert.test.ts
ā”œā”€ā”€ ascii/
│   ā”œā”€ā”€ cat1.txt              # sample grayscale ASCII art
│   └── cat1-color.txt        # sample ANSI color ASCII art
ā”œā”€ā”€ images/
│   ā”œā”€ā”€ cat1.png
│   ā”œā”€ā”€ cat1-color.png
│   ā”œā”€ā”€ cat1-large.png
│   └── cat1-color-large.png
ā”œā”€ā”€ assets/
│   └── unasciiclaw.png       # header image
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ LICENSE
ā”œā”€ā”€ README.md
ā”œā”€ā”€ biome.json
ā”œā”€ā”€ package.json
ā”œā”€ā”€ pnpm-lock.yaml
ā”œā”€ā”€ tsup.config.ts
└── tsconfig.json

Development

git clone https://github.com/psandis/unasciiclaw.git
cd unasciiclaw
pnpm install
pnpm build
pnpm test
pnpm lint
unascii --help

Testing

pnpm test

8 tests covering output dimensions, pixel brightness values, invert mode, scale, aspect fix, color ANSI parsing, format detection, and empty input handling.

Related

  • šŸ¦€ Asciiclaw: Convert images to ASCII art
  • šŸ¦€ Feedclaw: RSS/Atom feed reader and AI digest builder
  • šŸ¦€ Dustclaw: Find out what is eating your disk space
  • šŸ¦€ Driftclaw: Deployment drift detection across environments
  • šŸ¦€ Dietclaw: Codebase health monitor
  • šŸ¦€ Wirewatch: Network traffic monitor with AI anomaly detection

License

See MIT

About

Convert ASCII art to an image. CLI tool for the OpenClaw ecosystem.

Topics

asciiascii-artascii-to-imagecliimagenodejsopenclawsharpterminaltypescript

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.