- Generate organic surfaces (paper, stone, fabric, gradients). Draw grids, stripes and anything with text in CSS or SVG.
- Most models return about 1 to 1.5 megapixels. Upscale for heroes and inspect the result at 100 percent.
- Fix tile seams with a 50 percent offset, and add 1 to 3 percent grain to stop banding in dark gradients.
- Ship WebP or AVIF with a
background-colorfallback, check 4.5:1 text contrast, and save the prompt, seed and tool terms.
An image model can give you a new texture in thirty seconds. Getting that texture onto a live page is the slower part: the file is too small, the edges do not tile, the dark areas band, the text on top is unreadable and nobody is sure who owns it. This guide covers that second half, step by step, with the sizes, CSS and checks we use for our own sets.
The same workflow scales from one hero image to a pipeline that makes hundreds of brand-consistent variants. That larger version is usually a job for a team that offers custom generative ai development services, because it needs fixed prompts, seeds, review queues and storage, not just a chat window.
If you only need a finished background today, our free background library already passes every check on this page.
What are image models good at for backgrounds?
Image models are good at surfaces with no meaning: paper, plaster, fabric, stone, soft gradients, bokeh and abstract ink. They are weak at anything with exact structure, such as straight grids, readable text, logos, symmetric patterns and repeating geometry with a precise pitch.
That split decides the tool. Use a model for organic texture. Use CSS or SVG for geometry: a grid, stripes or dots drawn in code are sharper, weigh a few hundred bytes and never blur. Our guide to SVG pattern backgrounds covers that side.
| Background type | Generate it? | Better option |
|---|---|---|
| Paper, linen, concrete, stone | Yes | Model plus a seam fix |
| Soft gradient mesh, glow, aurora | Yes, or CSS | CSS gradients if the shapes are simple |
| Photographic scene behind a hero | Yes, with care | Check for odd details at full size |
| Grid, dots, stripes, isometric lines | No | CSS or SVG pattern |
| Anything with text, a logo or UI | No | Design it by hand |
How do you write a prompt for a usable background?
Describe the surface, the light and the empty space, then exclude what you do not want. A background prompt is closer to a material spec than to an art brief.
- Surface. Name the material and its scale: "fine-grain recycled kraft paper, fibers visible at close range".
- Light. Flat, even light for tiles. Directional light only for single hero images, because a shadow direction breaks when the image repeats.
- Tone. Give the range: "mid-dark, no pure white, no pure black". This keeps room for text and for a dark mode version.
- Composition. "Top-down, orthographic, no focal point, uniform detail across the frame" for tiles. "Subject on the right third, empty space on the left" for a hero with a headline.
- Exclusions. "No text, no letters, no logos, no watermark, no frame, no vignette".
These modifiers change the result most:
| Modifier | What it does | Use for |
|---|---|---|
seamless, tileable | Asks for edges that match | Repeating textures |
top-down, orthographic | Removes perspective | Tiles, paper, fabric |
even, diffuse lighting | Removes hot spots and shadows | Tiles |
no vignette | Stops dark corners | Everything that repeats or crops |
negative space on the left | Leaves room for a headline | Hero sections |
low contrast, muted | Keeps detail quiet under text | Content areas |
Save the exact prompt, the model, the seed and the date next to the file. You will need them for a dark variant, for a matching second image and for any question about where the file came from.
Is the output big enough for a website?
Usually not. Most models return an image of about one to one and a half megapixels, for example 1024×1024 or 1536×1024. A full-width hero on a 1440-pixel laptop at 2x density needs 2880 pixels across. Plan the size first, then upscale.
| Use | Target width | Notes |
|---|---|---|
| Full-width hero | 1920 to 2560 px | Serve smaller copies to phones |
| Section or card background | 1200 to 1600 px | Our sets ship at 1600×1200 |
| Repeating tile | 256 to 1024 px square | Small is fine, it repeats |
| Mobile app screen | 1290 to 1440 px wide | Portrait crop, keep detail central |
Upscale, then inspect at 100 percent
An AI upscaler doubles or quadruples the size and invents fine detail. On paper and stone that works well. On faces, hands, text-like marks and straight edges it adds artifacts. Zoom to 100 percent and scan the whole frame before you accept the file. A 2x upscale of a 1536-pixel image gives 3072 pixels, enough for any hero.
Tiles rarely need upscaling. A 1024-pixel tile repeated across a page looks sharp because each copy is shown near its real size.
How do you make a generated texture tile without seams?
Offset the image by half its width and height, fix the cross that appears in the middle, then test it repeated. A "seamless" prompt helps, but most models still leave visible edges.
- Crop to a square.
- Offset by 50 percent on both axes. In Photoshop use Filter, Other, Offset; in GIMP use Layer, Transform, Offset with wrap-around.
- The old edges now meet in a cross at the center. Clone or heal along that cross until it disappears.
- Look for a feature that stands out, such as a dark knot or a bright fleck. In a repeat it becomes a visible rhythm. Paint it out.
- Check the brightness on both sides. A left half that is lighter than the right shows as stripes when tiled.
- Test at real size with CSS before you export.
.tile-test {
min-height: 100vh;
background: #1a1b1e url(/img/linen-tile.webp) repeat;
background-size: 512px 512px;
}Our full method is in the guide to seamless tileable textures.
Why do dark generated gradients show bands?
The model renders smooth gradients, and 8-bit export plus lossy compression turns them into visible steps. The fix is a small amount of noise added before export. Banding is worst in dark blues, purples and greys, which is exactly where dark sites live.
Add 1 to 3 percent monochrome grain to the image. It breaks the steps, and the encoder keeps the gradient smooth. Our article on grain and noise in web design shows the settings, and the subtle grain gradient set is a ready example.
How do you compress and serve the file?
Export to WebP or AVIF, keep a JPEG only if you support very old browsers, and give the browser a choice. A generated PNG often weighs 1 to 4 MB. A good hero ends up between 80 and 250 KB.
- Resize to the target width first. Never ship a 3000-pixel image to a 400-pixel phone.
- Encode WebP at quality 75 to 82. Google's WebP documentation puts lossy WebP at 25 to 34 percent smaller than comparable JPEG.
- Try AVIF for large heroes. It usually saves more on smooth gradients.
- Check the decoded cost, not only the file size. A decoded image takes about 4 bytes per pixel, so a 2560×1440 hero uses around 14.7 MB of memory.
In CSS, image-set() lets the browser pick the format and density:
.hero {
background-color: #14161a;
background-image: image-set(
url(/img/hero-texture.avif) type("image/avif"),
url(/img/hero-texture.webp) type("image/webp")
);
background-size: cover;
background-position: center;
}The background-color is the fallback and the placeholder. Pick the darkest tone of the image so the page does not flash white while the file loads. MDN's image-set() reference lists the syntax and browser support.
Watch the LCP if the background is the hero
A CSS background is found late, after the stylesheet loads. When it is the largest element in view, it often sets Largest Contentful Paint, and web.dev rates an LCP under 2.5 seconds as good. Preload the file, or use an <img> with fetchpriority="high". Our guide to fast background images walks through both.
How do you keep text readable on a generated background?
Put a scrim between the image and the text and measure the result. Generated images often have bright patches you did not ask for.
.hero {
background-image:
linear-gradient(rgb(8 9 10 / .55), rgb(8 9 10 / .55)),
url(/img/hero-texture.webp);
background-size: cover;
}The target is the WCAG contrast minimum: 4.5:1 for body text, 3:1 for large text. Measure on the brightest area that can sit behind a letter. Details are in our guide to readable text on background images.
Make the dark variant from the same prompt
For dark mode, do not just lower the brightness of the light file. Re-run the same prompt and seed with a darker tone range, or edit the light file into a dark one with lower internal contrast and no white highlights. Then swap it with a media query:
@media (prefers-color-scheme: dark) {
.hero { background-image: url(/img/hero-texture-dark.webp); }
}More on the visual side in backgrounds for dark mode.
Who owns an AI-generated background?
Check two things: what the tool's terms let you do, and what the law protects. They are not the same.
- Tool terms. Most paid image tools allow commercial use of outputs. Free tiers sometimes do not. Read the terms of the plan you used on the day you generated the file, and keep a copy.
- Copyright. The US Copyright Office holds that material generated by AI from a prompt alone is not protected by copyright; human authorship is required. You can use the file, but you may not be able to stop others from copying it. Substantial human editing can change that for the edited parts.
- Provenance metadata. Some tools embed C2PA Content Credentials that record how an image was made. Many encoders drop metadata by default. Decide whether you want to keep it, and check the exported file.
- Disclosure. Article 50 of the EU AI Act, which applies from August 2026, requires generative tools to mark their outputs in a machine-readable way. The disclosure duty for publishers targets deepfakes and certain public-interest texts, not abstract textures. A paper texture behind a pricing table does not need a label.
Our guide to free background licenses explains how this compares with stock and free libraries, and the Web Backgrounds license shows the terms for our own files.
What changes when you need hundreds of backgrounds?
The work moves from prompting to process. One designer can make five good backgrounds by hand. A product with seasonal themes, per-category banners or user-chosen app themes needs a pipeline.
- Fixed prompt templates with slots for material, tone and color, so every output belongs to one family.
- Style references or a tuned model to keep the brand look stable across runs.
- Automatic checks: size, file weight, average brightness, contrast against the planned text color, and a seam test for tiles.
- A human review queue. Automatic checks miss odd details, extra fingers and stray letters.
- A record per file: prompt, seed, model version, date and reviewer.
Teams that build this usually connect the image API to their CMS or design system, so an approved background lands in the right size and format without manual export.
A checklist before you publish
- The subject is a surface, a gradient or a scene, not geometry, text or a logo.
- The prompt, model, seed and date are saved with the file.
- The file is at least as wide as the largest place it appears.
- The upscaled file was inspected at 100 percent.
- Tiles pass the 50 percent offset test and look even when repeated.
- Dark gradients have light grain and show no bands.
- The file is WebP or AVIF, resized, and the hero is under about 250 KB.
- A
background-colorin the image's darkest tone is set as a fallback. - Text on top reaches 4.5:1 contrast on the brightest area.
- A real dark variant exists if the site has dark mode.
- The tool's commercial-use terms are saved.
Need something that already passes? Start with the soft gradient mesh backgrounds or browse background textures.



