# Background pattern generator

Make seamless SVG background patterns (dots, grid, stripes, checker or waves) with your colours and scale.

- Endpoint: `POST https://setget.net/v1/tools/pattern-image` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `pattern-image`
- Page: https://setget.net/tools/pattern-image

## Inputs

- `pattern` (optional, string, one of `dots`, `grid`, `stripes`, `checker`, `waves`, default `"dots"`): The pattern to draw.
- `foreground` (optional, string, default `"#cbd5e1"`): Pattern colour: hex or a basic colour name.
- `background` (optional, string, default `"#f8fafc"`): Background colour: hex, a basic colour name, or "transparent".
- `scale` (optional, integer, default `24`, range 4..400): Size of one repeating tile in pixels.
- `width` (optional, integer, default `480`, range 1..4000): Width of the preview image in pixels.
- `height` (optional, integer, default `320`, range 1..4000): Height of the preview image in pixels.

## Example 1: Dots

```json
{"input":{"pattern":"dots"}}
```

## Example 2: A small checkerboard

```json
{"input":{"pattern":"checker","scale":8,"width":16,"height":16,"foreground":"#000","background":"#fff"}}
```

Result:

```json
{"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><defs><pattern id=\"sg34c1c6c4\" width=\"8\" height=\"8\" patternUnits=\"userSpaceOnUse\"><path d=\"M0 0h4v4h-4zM4 4h4v4h-4z\" fill=\"#000000\"/></pattern></defs><rect width=\"16\" height=\"16\" fill=\"#ffffff\"/><rect width=\"16\" height=\"16\" fill=\"url(#sg34c1c6c4)\"/></svg>","width":16,"height":16,"tile":"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"8\" height=\"8\" viewBox=\"0 0 8 8\"><rect width=\"8\" height=\"8\" fill=\"#ffffff\"/><path d=\"M0 0h4v4h-4zM4 4h4v4h-4z\" fill=\"#000000\"/></svg>"}
```

## Example 3: Waves on a dark background

```json
{"input":{"pattern":"waves","scale":40,"foreground":"#2a78d6","background":"#0f172a"}}
```

**How do I use it as a page background?** Save the "tile" SVG as a file and set it as a repeating CSS background-image. The tile repeats without visible seams.
