Quick start
A single function call handles everything: loading, pixel extraction, conversion, and rendering. No manual canvas setup required.
import { asciify } from 'asciify-engine';
const canvas = document.querySelector('canvas')!;
// Minimal — convert from a URL
await asciify('https://example.com/photo.jpg', canvas);
// With your own characters
await asciify(document.querySelector('img')!, canvas, {
options: { charset: ' .ilLCFTYASMW' },
});
// Full options — max control
await asciify(img, canvas, {
fontSize: 8,
options: {
colorMode: 'fullcolor',
invert: true,
animationStyle: 'current',
hoverEffect: 'spotlight',
hoverStrength: 0.5,
},
});ASCII backgrounds
A live ASCII background behind any element, in one call: 15 presets (swell, halo, caustics, ripple, Fluid and more) through background() from asciify-engine/kit, drawn on the GPU.
import { background, halo } from 'asciify-engine/kit';
// Under #hero's content; follows light and dark, quiet round the headline
const bg = background(document.querySelector('#hero'), {
preset: halo,
clear: document.querySelector('#hero h1'),
cursor: false, // optional: no pointer response
});
// Always clean up on unmount:
bg.destroy();