Impasto

Sunrise over a misty valley with lone pines on a grassy slope
About this component

Impasto

A live oil painting that paints itself from any photo: thick brushstrokes follow the picture's contours from broad blocking-in to fine detail, each with bristle grooves and ridges of paint, lit by a raking light that glints on the wet surface while linen shows through the thin passages. The light follows the cursor, dragging with a mouse lays fresh strokes, and the finished canvas is slowly painted over again. Stroke size, count, pace, thickness, flow, sheen, canvas texture and primer are all props. Adapts its resolution, pauses offscreen, paints the finished canvas at once for reduced motion and falls back to the plain photo without WebGL.

Usage

The import and the props worth knowing about, in one place.

import { Impasto } from "@/components/beste/component/impasto";

<Impasto
  className="aspect-[4/3]"
  src="https://images.unsplash.com/photo-1470252649378-9c29740c9fa8?w=1600&q=80"
  alt="Sunrise over a misty valley"
  strokeSize={0.7}     // broader brushwork, 0 to 1
  thickness={0.8}      // taller ridges of paint
  flow={0.4}           // looser, swirling strokes
  sheen={0.6}          // wet shine under the light
  repaint={0}          // keep the finished painting
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
src*string—Photo the painting is made from. Loaded with CORS so the canvas can read its colors.
altstring—Description of the photo for screen readers.
strokeSizenumber—Size of the brushstrokes, 0 (fine) to 1 (broad).
strokesnumber—Brushstrokes laid down for one painting.
paintTimenumber—Seconds one painting takes to lay down.
thicknessnumber—Height of the paint ridges under the raking light, 0 to 1.
flownumber—How closely strokes follow the photo's contours, 0 (loose swirl) to 1 (along every edge).
sheennumber—Wet shine on the paint, 0 to 1.
canvasTexturenumber—Linen weave showing through thin paint, 0 to 1.
repaintnumber—Seconds a finished painting rests before it is painted over again; 0 keeps it.
primerColorstring—Color of the primed canvas. Any CSS color.
lightFollowboolean—The raking light follows the cursor.
interactiveboolean—Dragging with a mouse lays fresh strokes.
pausedboolean—Freeze the painting where it is.
classNamestring—
childrenReactNode—

More Media components

View all Media
A modern house with wide glass walls and a pool
A model in wide striped trousers leaning on a teal wall
Portrait of a man in a grey sweater against a pale wall