# SVG Backdrop Generator: replication prompt

Paste this into Claude, Cursor, Replit, Lovable or v0.

```text
Build a self-contained index.html tool, "SVG Backdrop Generator". Left sidebar (310px, Geist + Geist Mono labels): style buttons (Layered waves, Blob scene, Layered peaks, Contour lines), six palette swatches of six colors each (dark to light), size buttons (1456x816, 1200x630, 1080x1350), sliders for layers (2-9), complexity (2-14), amplitude (0.1-1) and grain (0-0.6), New seed and Flip buttons, and SVG and PNG @2x export buttons. Use a seeded mulberry32 RNG so output is reproducible. Build every SVG as a string: waves are stacked filled paths through random points smoothed with Catmull-Rom to cubic Bezier; peaks are zig-zag polylines; blobs are smoothed closed shapes under an feGaussianBlur filter; contours are concentric smoothed rings with a shared per-angle noise offset. Grain is an feTurbulence + feColorMatrix overlay rect. Show the SVG in a framed preview with a caption of style, palette, seed, size and file size. PNG export draws the SVG data URL onto a 2x canvas.
```

## Key code

```js
// Catmull-Rom to cubic Bezier: smooth path through any points
function smooth(pts, closed){
  const P = closed ? [pts.at(-1), ...pts, pts[0], pts[1]] : [pts[0], ...pts, pts.at(-1)];
  let d = `M${P[1][0]},${P[1][1]}`;
  for (let i = 1; i < P.length - 2; i++){
    const [p0,p1,p2,p3] = [P[i-1],P[i],P[i+1],P[i+2]];
    d += ` C${p1[0]+(p2[0]-p0[0])/6},${p1[1]+(p2[1]-p0[1])/6} ${p2[0]-(p3[0]-p1[0])/6},${p2[1]-(p3[1]-p1[1])/6} ${p2[0]},${p2[1]}`;
  }
  return d + (closed ? 'Z' : '');
}
```
