Canvas

ASCII Renderer

A retro-styled renderer that converts images into character-based visuals with configurable scanlines.


Installation

Install the component

Run the following command to install the component and its dependencies:
npx @motion-core/cli add ascii-renderer

Import the component

Import the component into your Svelte file:
import { AsciiRenderer } from "$lib/motion-core";
import { AsciiRenderer } from "$lib/motion-core";

Usage

<script lang="ts">
	import { AsciiRenderer } from "motion-core";

	const demoImage = "/images/demos/sample-11.jpg";
</script>

<AsciiRenderer src={demoImage} color="#00ff00" class="h-full min-h-96 w-full" />

Props

AsciiRenderer

PropTypeDefault
src
string
density
number 25
strength
number 3.0
color
stringnumber[number, number, number]{ r: number; g: number; b: number } "#00ff00"
backgroundColor
stringnumber[number, number, number]{ r: number; g: number; b: number } "#17181A"
class
string ""