Grainy Gradient Generator
Pick a start color, an end color, one of five directions, and a Grain Intensity from 0 to 100 percent. The preview shows a linear gradient with film-style noise laid over it. The result is a self-contained SVG: Copy CSS gives you a background-image with the SVG embedded as a base64 data URI, and Download SVG saves it as a 1000 by 1000 file. A Random Colors button rerolls both colors for quick exploring.
How to make a grainy gradient
- Set Start Color and End Color with the pickers or six-digit hex codes. The defaults are
#667eeaand#764ba2. - Choose a Gradient Direction: diagonal down-right, vertical down, horizontal right, vertical up, or diagonal up-right.
- Move Grain Intensity from 0 to 100 percent and check the Live Preview.
- Press Random Colors if you want a new pair to start from.
- Press Copy CSS to copy the data-URI rule, or Download SVG to save
grainy-gradient.svg.
How the grain is made, and a trade-off to know about
The noise is not a bitmap. The SVG uses an feTurbulence filter with fractal noise at a base frequency of 0.9 and four octaves, desaturated to gray, with its alpha snapped to either 0 or your intensity value. That noise layer is drawn over the gradient at 50 percent opacity. The visual grain is therefore generated by the browser when the image renders, which keeps the file small and scalable.
The trade-off is that the copied CSS is a long base64 string, not a readable linear-gradient(), so keep the hex values somewhere if you want to tweak colors later. The rule also sets background-size: cover, which scales the 1000 by 1000 artwork to the element: grain gets coarser on a large hero and finer on a small card, and a wide element shows only the top of the square. Large filtered backgrounds can also be slower to paint than a plain gradient.