image-to-ascii

Solid

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).

AI & Automation 1 stars 0 forks Updated 3 days ago Apache-2.0

Install

View on GitHub

Quality Score: 80/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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...

Details

Author
vinsonconsulting
Repository
vinsonconsulting/claude-skill-foundry
Created
1 months ago
Last Updated
3 days ago
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

ascii-art

ASCII art: pyfiglet, cowsay, boxes, image-to-ascii.

12 Updated 6 days ago
kevinnft
Web & Frontend Listed

ascii-img-react

Use when rendering images as ASCII art in the browser or a React app with the ascii-img-react library — the shape-vector (not brightness-ramp) approach that keeps edges sharp. Trigger when ascii-img-react or <AsciiImage> is named; when the user wants an image-to-ASCII React component, a terminal/retro ASCII image effect on a web page, a click-ripple or rain ASCII animation over an image, or to theme ASCII output via CSS variables; or when they reach for the low-level utilities (sampleCell, sampleGrid, sampleExternalCircles, findBestCharacter, CachedCharacterLookup, applyGlobalContrast / applyDirectionalContrast, NORMALIZED_CHARACTERS). Covers install, the <AsciiImage> props, CORS/sizing/performance caveats, CSS-variable theming, Astro/Next integration, and the 6D shape-vector technique it implements. Not for converting an image file to ASCII from the command line in Python (use image-to-ascii), and not for real-time generative textmode graphics on a WebGL grid (use textmode-js).

1 Updated 3 days ago
vinsonconsulting
AI & Automation Listed

imagegen

Generates or edits raster images with AI (photos, illustrations, textures, sprites, mockups, logos, infographics), including transparent-background cutouts. Use when the task needs an AI-created or AI-edited bitmap; not for SVG/vector or code-native visuals.

1 Updated today
Firzus