Morphiq

Components / Text Animations / Bitmap Text

Bitmap Text

Type rasterised and dithered into particles. Grain decides whether the letterforms read as solid or as a cloud that still resolves as words.

Usage

import BitmapText from '@/components/bitmap-text'

<BitmapText
  text="BITMAP"
  grain={0.6}
  cell={5}
  dither="bayer4"
/>

Installation

npx shadcn@latest add https://morphiq.prathampatel.design/r/bitmap-text.json

Model

(v) => String(v.dither).startsWith("bayer") ? "out = level(tone + (M(x, y)/n² − ½)/levels)" : v.dither === "none" ? "out = round(tone · (levels − 1)) / (levels − 1)" : "e = tone − out;  e spreads to unvisited neighbours by the kernel’s weights"

M the Bayer matrix, n its size · error diffusion carries each cell’s rounding error forward, so tone is conserved over area

Props

PropertyTypeDefaultDescription
cellnumber5Pixels per cell. Smaller is finer and costs more per frame.
levelsnumber2Tone steps. 2 is one-bit; higher posterises.
ditherDitherKernel'bayer4'—
ditherAmountnumber10 passes the tone through untouched, 1 applies the kernel in full.
serpentinebooleantrueAlternate scan direction. Error-diffusion kernels only.
contrastnumber1—
brightnessnumber0—
invertbooleanfalse—
warpnumber0Flow-field shear, in cells.
cursorRadiusnumber160Reach of the pointer's influence, in px.
cursorStrengthnumber0Outward push at the centre of that reach, in px.
cursorLiftnumber0Luminance added at the centre of that reach.
colorstring'#e8e4dc'—
backgroundstring | null'#0a0b0e'null renders transparent.
pausedbooleanfalseStops the frame loop without unmounting.
respectReducedMotionbooleantrueHonour prefers-reduced-motion, and keep honouring it if it changes.
fullscreenbooleanfalsePosition the field to the viewport rather than its container.
textstring'BITMAP'Rasterised to the canvas, and used as the element's accessible name.
fontFamilystring'ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif'—
fontWeightnumber | string800—
fontSizenumber | 'auto''auto'CSS px, or 'auto' to fill the box.
letterSpacingnumber0In em.
lineHeightnumber1.05—
align'left' | 'center' | 'right''center'—
paddingnumber24Inset from the edges, in CSS px.
grainnumber0.60 leaves the glyphs solid; 1 is pure particles.