Installation
Install the component
Run the following command to install the component and its dependencies:
Import the component
Import the component into your Svelte file:
Usage
Props
80
3.000
Canvas
A retro-styled renderer that converts images into character-based visuals with configurable scanlines.
npx @motion-core/cli add ascii-renderernpx @motion-core/cli add ascii-rendererimport { AsciiRenderer } from "$lib/motion-core";import { AsciiRenderer } from "$lib/motion-core";<script lang="ts">
import { AsciiRenderer } from "motion-core";
import type { ComponentProps } from "svelte";
const demoImage = "/images/photos/sample-image-17.webp";
type Props = Partial<ComponentProps<typeof AsciiRenderer>>;
let {
density = 25,
strength = 3,
color = "#00ff00",
backgroundColor = "#17181A",
}: Props = $props();
</script>
<AsciiRenderer
src={demoImage}
class="h-full min-h-96 w-full"
{density}
{strength}
{color}
{backgroundColor}
/>
<script lang="ts">
import { AsciiRenderer } from "motion-core";
import type { ComponentProps } from "svelte";
const demoImage = "/images/photos/sample-image-17.webp";
type Props = Partial<ComponentProps<typeof AsciiRenderer>>;
let {
density = 25,
strength = 3,
color = "#00ff00",
backgroundColor = "#17181A",
}: Props = $props();
</script>
<AsciiRenderer
src={demoImage}
class="h-full min-h-96 w-full"
{density}
{strength}
{color}
{backgroundColor}
/>
| Prop | Type | Default |
|---|---|---|
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 | "" |