Engrave image (Pro)
ProIncluded in $99Any 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.
On this page
ProA portrait cut as a line engraving. Relief bends the lines around the form; hover or focus shows the photo.
Installation
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
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
| Prop | Type | Notes |
|---|---|---|
src, alt | string | alt is required: it is the accessible name |
lines | number | Lines across the height. Default one per 5 CSS px |
angle | number | Line direction in degrees. Default 0, horizontal |
relief | number | 0 to 1: how far the light bends the lines. Default 0.5 |
cross | boolean | Cross hatch the deep shadows. Default true |
ink, paper | string | Any CSS color or token. paper may be transparent |
contrast, brightness, threshold | number | Defaults 1.1, 0 and 0.5 |
invert | boolean | Lines stand for light instead of dark |
reveal | boolean | Original on hover, keyboard focus, or press and hold on touch |
aspectRatio, width, height | Set the frame before the image loads, so nothing shifts | |
maxPixels | number | Default 1.5 MP. Lower it for many tiles |
renderer | "auto" | "webgl" | "2d" | Force a path |
onStatusChange | (status: "loading" | "ready" | "error") => void |
Keyboard
| Key | Action |
|---|---|
Tab | With reveal, focus shows the original; leaving hides it |
Accessibility
- The canvas is
aria-hidden. The real<img>with youraltsits underneath and is what screen readers announce. - Under
forced-colors: activethe effect hides and the plain image shows with system colors. - Under
prefers-contrast: moreink 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.