JavaScript
import { createAsciiFx } from 'ascii-fx';
const fx = createAsciiFx(stage, {
source: img,
charset: 'classic',
color: 'duotone',
interaction: 'repel',
});
zero dependencies · images, video, webcam
ascii-fx renders a picture as living type. Ordered dither, Floyd–Steinberg, halftone, and a cursor that the characters have to get out of the way of.
Move the cursor — the type scatters and springs back.
playground
Drop an image or clip
Samples: NASA public-domain Apollo photographs. Drag one onto the frame, or bring your own.
install
import { createAsciiFx } from 'ascii-fx';
const fx = createAsciiFx(stage, {
source: img,
charset: 'classic',
color: 'duotone',
interaction: 'repel',
});
<script type="module">
import 'ascii-fx/element';
</script>
<ascii-fx src="cover.jpg"
charset="blocks" interaction="repel">
</ascii-fx>
React, Vue, and Svelte use the same <ascii-fx> tag. Examples are in the
README.