xtract.bot
POST /api/image-png-to-ascii

Convert a PNG to ASCII art — plain text or per-character coloured HTML. Configurable width, character ramp, invert mode.

Decodes the input PNG, downsamples it to the requested character grid, and maps each cell's average luminance to a character from a configurable ramp. Inputs: - `image`: PNG bytes. - `width`: output character columns (default 80, max 400). - `ramp`: preset name (`standard`, `blocks`, `detailed`) or a custom string ordered low → high luminance. - `invert`: flip the luminance → character mapping. - `format`: `text` (default) or `html` (per-character coloured `<pre>` block).

Inputs

NameTypeDefaultDescription
image*filePNG bytes.
widthnumber (8…400)80Output character columns (default 80).
rampstring"standard"Preset name (standard|blocks|detailed) or a custom ramp string of at least two characters.
invertbooleanfalseFlip the luminance→character mapping.
formatenum (text | html)"text"`text` for plain ASCII; `html` for a coloured <pre> document.

Response

Modes: text, json. Cache: yes (24h TTL).