Pikkola SVG Wave, tool No. 90

A section edge that looks drawn, not cut.

Layered waves, an organic blob and a divider, all as plain SVG you can paste. Set the amplitude, the period and the colours, drag a seed until the shape feels right, and leave with markup, a CSS background or a file.

3
shapes
1200
unit viewBox
0
bytes of script

The shoreline bench

One curve, three shapes

A wave is a sine sampled along the width and drawn as a smooth curve. A blob is the same curve closed on itself from a seeded set of points. A divider is a wave on a short band. All three come out as markup with no script in it.

The stage shows the markup the SVG tab carries.


    
    

What is generated, exactly

The output is a path in a viewBox, not a bitmap and not a canvas. That is why it stays sharp at any width and why it costs one line of CSS.

01

The curve passes through its points

Points are sampled from a sine across the width and joined with a Catmull-Rom spline written as cubic beziers. The curve touches every point, so amplitude and period mean what they say instead of being smoothed away by an approximation.

02

The seed is the whole blob

A blob is a ring of points at angles around a centre, each pushed in or out by a seeded generator. The same seed draws the same shape every time, so a shape you liked in the preview is a shape you can ship, and a number in a comment brings it back.

03

Two outputs, one source

The SVG tab is the element itself. The CSS tab is the same markup as a data URI in a background rule, which is what a section needs when you cannot add markup. Both come from one function, so they cannot drift apart.

What the output is, and what it stays out of

A decorative SVG that goes into a section has to be small, inert and honest about its size. These are the choices this page makes.

Part What this page does What it will not do
The markup One svg element, a gradient in defs, and one path per layer with a fill and an opacity Add script, a font, an external image or an animation
Scaling preserveAspectRatio none for wave and divider, so the curve stretches to the box Measure the element and redraw on resize, which needs script
The blob A closed path from a seeded set of points, repeatable from the seed Read an image and trace its outline
The CSS A background rule with the SVG as an encoded data URI and background-size 100% 100% Reference an external file, so the page depends on another request
Colours A two stop gradient per shape, with lower layers in the second colour at lower opacity Guess a palette, or fetch one from a service
The file Downloaded from the tab with the name of the shape Upload the SVG anywhere

The wave is generated, not traced, so a very small period against a wide box will produce a path with many segments. Above about forty periods the markup grows faster than the shape improves, and the count under the stage tells you when.

Field guide

Curves, seeds and stretch

A wave that ships as markup has three properties worth understanding: the curve is exact, the shape is repeatable from a number, and the stretching is a decision rather than a side effect.

From a sine to a path

The wave is sampled at period × 18 points across the width, each at base − amplitude × sin(t × period × 2π + phase). Those points are joined with a Catmull-Rom spline converted to cubic beziers, which produces a curve that passes through every sample: the control points are derived from the neighbouring points rather than guessed, so the visible amplitude stays where the slider says.

Sampling density is the one trade in the generator. Too few points and a short period looks faceted; too many and the path grows without improving the shape. Eighteen samples per period keeps a full-bleed section smooth at about six kilobytes of markup, which is less than one photograph's worth of bytes for a shape that stays sharp at any width.

Why a blob needs a seed and not a random call

A blob is a ring of points around a centre, each pushed in or out by a small random factor and joined with a closed spline. If that randomness came from Math.random(), the shape would change on every reload and could never be shipped or discussed. A 32-bit integer seed feeding mulberry32 makes the sequence a pure function of the number: the same seed gives the same seven points in the same order, so the blob is a document you can reproduce, not a moment you happened to catch.

Consecutive layers are drawn from the seed plus a prime offset, so two layers of one blob are related but not identical, which is what makes a stacked blob read as depth rather than as a blurred edge.

preserveAspectRatio, and the amplitude that follows

A wave section usually wants to fill its container at any width, so the SVG is written with preserveAspectRatio="none". The viewBox is 1200 wide and 320 tall; a 1920-pixel container stretches the curve by 1.6 horizontally and leaves the height alone, which flattens the apparent amplitude. That is normally fine, and it is why the amplitude slider goes higher than a fixed-width design would need. When the amplitude has to be exact, keep the aspect ratio and let the SVG letterbox, or set a fixed background-size and repeat.

Data URI output, and where it stops

The CSS tab encodes the same markup with encodeURIComponent and puts it in a background-image. Every # in a colour becomes %23, which is the detail hand-written data URIs get wrong: an unencoded hash ends the URI at the fragment and the background silently disappears. The page also writes background-size: 100% 100%, because a data URI background defaults to the image's intrinsic size and would tile a 1200-wide wave across the element.

This form is for a web page. Most mail clients strip data URI backgrounds, and a CMS that sanitises CSS will strip them too; there, download the SVG and use it as an image with an empty alt, since the shape is decoration.

Decoration has rules too

The generated markup has no script, no external reference and no foreignObject, so it can be inlined in a page with a strict content policy and it cannot execute anything. Put aria-hidden="true" on a decorative inline SVG, or keep the role="img" and label this page writes and give it a real description if the shape carries meaning. And watch the contrast of text placed on top: a two-stop gradient from a dark to a light colour will fail a contrast check somewhere along its length, so either keep the text on the safe end or add a scrim.

When the section needs a background behind the wave, Pikkola Gradient makes the layers. When the shape is a sheet of sprites rather than an edge, Pikkola Sprite is the page.

Questions

Is this image generation?

No, and that is the point. Nothing is drawn by a model: a sine, a seeded ring of points and a spline produce the path, so the result is exact, tiny and repeatable. The same seed gives the same blob today and next year, in any browser.

Can I use it in a commercial page?

Yes. The markup is produced by the page from your parameters and there is nothing to license. No attribution is required. A link is welcome but it is not a condition.

Why does the wave stretch on a very wide screen?

Because preserveAspectRatio is off so the curve fills the box. Stretching changes the apparent amplitude, which is usually what a section wants. If you need a fixed amplitude, wrap the SVG in a container with a max width, or set background-size to a fixed height and repeat on the x axis.

What makes the blob reproducible?

A 32-bit seed feeds mulberry32, and each point's distance from the centre is drawn from it in a fixed order. The number is in the control and in the markup you copy, so writing it in a comment beside the SVG is enough to regenerate the identical shape later.

Does the CSS version work in email?

Data URI backgrounds are blocked in most mail clients, Gmail and Outlook among them, so no. For email, export the SVG and use it as an image, or accept a flat colour. The CSS tab is for a web page.