← ClaudeAtlas

image-to-asciilisted

Use when converting an image file to ASCII art outside the browser — a command-line or script run that turns a photo, logo, screenshot, or render into text, saved as .txt or rendered to .png/.svg. Trigger on "make ASCII art of this image/photo/cat", "convert this picture/logo to ASCII", "turn this PNG into an ASCII text file for my README", batch-converting a folder of images to ASCII, or any Python/Pillow image-to-ASCII task. Produces sharp, shape-aware output by matching each cell to the glyph whose shape fits best (6D shape vectors + nearest-neighbour, optional contrast enhancement) rather than a naive brightness ramp, and bundles a monospace font for deterministic results. Runs scripts/image_to_ascii.py. Not for ASCII graphics on a web page or in React (use ascii-img-react), not the real-time textmode.js library (use textmode-js), and not figlet-style text banners (this converts images, not words).
vinsonconsulting/claude-skill-foundry · ★ 1 · AI & Automation · score 75
Install: claude install-skill vinsonconsulting/claude-skill-foundry
# image-to-ascii Convert an image file to ASCII art from the command line — to stdout, a `.txt` file, or a rendered `.png`/`.svg` — using shape-aware glyph matching. The converter is `scripts/image_to_ascii.py`: Pillow-only, pure-Python, Python 3.9+. ## Mental model - A naive ASCII converter picks one glyph per cell off a brightness ramp (`" .:-=+*#%@"`). That is nearest-neighbour downsampling — every cell is treated as a pixel, so edges come out jagged and curves look like staircases. - This converter instead reduces **both** each glyph **and** each image cell to a **6D shape vector** (six staggered sampling circles in a 2×3 grid) and matches the glyph whose *shape* is closest. A diagonal edge picks `/` or `\`, a top bar picks `"`/`^`, a base picks `_`. Edges stay crisp because shape, not just average brightness, drives the choice. - Glyph vectors are computed by **actually rasterizing the bundled font**, so the match reflects the real ink — and `png`/`svg` output draws with that same font, so the rendered image is self-consistent with the text. - **Polarity:** by default **dark pixels → dense glyphs** (`@`, `#`), which looks right as text on a light background (a README, a `.txt`). For light-on-dark output (terminal style, e.g. white-on-black), add `--invert`. For the full technique — circle geometry, the contrast-enhancement formulas, the luminance coefficients, caching — read `references/technique.md`. ## Setup The converter needs Pillow (nothing