Skip to content
Sign upPro
EffectsEngrave imageMenu

Engrave image (Pro)

ProIncluded in $99

Any image as a line engraving: parallel lines that bend with the picture's light so they wrap the form, swell with its shadows and cross hatch the darkest parts, in ink and paper from your tokens.

ProA portrait cut as a line engraving. Relief bends the lines around the form; hover or focus shows the photo.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/engrave-image

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { EngraveImage } from "@/components/ui/chatcn/pro/engrave-image"

<EngraveImage src={image.url} alt={image.prompt} relief={0.6} aspectRatio="4:5" reveal />

Relief bends each line by the light under it, read through a blur one line wide, so the lines ride over a face instead of tracing every edge. Width reads the light at half a line, so detail survives. On a light ink the picture prints as white lines on a dark ground.

Props

PropTypeNotes
src, altstringalt is required: it is the accessible name
linesnumberLines across the height. Default one per 5 CSS px
anglenumberLine direction in degrees. Default 0, horizontal
reliefnumber0 to 1: how far the light bends the lines. Default 0.5
crossbooleanCross hatch the deep shadows. Default true
ink, paperstringAny CSS color or token. paper may be transparent
contrast, brightness, thresholdnumberDefaults 1.1, 0 and 0.5
invertbooleanLines stand for light instead of dark
revealbooleanOriginal on hover, keyboard focus, or press and hold on touch
aspectRatio, width, heightSet the frame before the image loads, so nothing shifts
maxPixelsnumberDefault 1.5 MP. Lower it for many tiles
renderer"auto" | "webgl" | "2d"Force a path
onStatusChange(status: "loading" | "ready" | "error") => void

Keyboard

KeyAction
TabWith reveal, focus shows the original; leaving hides it

Accessibility

  • The canvas is aria-hidden. The real <img> with your alt sits underneath and is what screen readers announce.
  • Under forced-colors: active the effect hides and the plain image shows with system colors.
  • Under prefers-contrast: more ink and paper snap to the text and canvas tokens and the lines get coarser, so they print solid.

Motion

  • The first frame fades in over 200 ms. Reveal crossfades over 150 ms; nothing moves or scales.
  • Under reduced motion only these short fades remain.