Skip to content
GPU-assistedUpload required

Put a Subject on a Two Color Ramp

A gradient is the single hardest thing to store in an ordinary image file, and almost nobody knows it until they see the stripes. Everything else in a photograph has texture and detail to hide the coarseness of eight bit color. A smooth ramp has nothing to hide behind, so the steps between one value and the next become visible bands — and the wider and subtler your gradient, the worse it gets.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free

Drop an image here, or click to browse

Up to 25 MB. Uploaded temporarily, deleted after processing.

GPU-assisted — results vary slightly between runs.

What it does

  • Ramp generated mathematically, not sampled
  • Subject pixels preserved exactly
  • No model anywhere in the workflow
  • Deterministic output every run

How to use Gradient Background

  1. 1

    Prefer a ramp with real color change

    Two clearly different colors band far less than two near-identical ones, because more steps are available across the same distance.

  2. 2

    Run the composite

    The subject is matted out and placed over a horizontal ramp built by interpolating between two colors across the frame.

  3. 3

    Check on a good screen at full size

    Banding is invisible on a phone and obvious on a large monitor. It is also far more visible in print than on any screen.

How it works

Two pixels are the whole backdrop.

A two by one image is created with one color on the left and another on the right. That is scaled up to the size of your photograph with bilinear interpolation, which computes every intermediate value between them across the width of the frame. Meanwhile a segmentation model produces a matte of your subject, and your original pixels are composited over the ramp through it.

No model generates any part of this. The ramp is arithmetic and the subject is copied, so the same upload produces exactly the same file every time.

Why gradients band and photographs do not

A standard image stores each channel in eight bits, which is two hundred and fifty six levels. That sounds generous and usually is.

In a photograph it is generous because everything is textured. Grain, detail, and noise mean adjacent pixels differ anyway, so the coarseness of the level ladder is buried in variation that is already there. Nobody has ever noticed quantization in a picture of a hedge.

A gradient has no variation to hide in. If the color changes by thirty levels across two thousand pixels, then on average a level has to persist for about sixty six pixels before stepping to the next one. That produces a sixty six pixel wide stripe of constant color with a hard boundary — and the human visual system is unusually good at detecting a hard boundary between two nearly identical tones, because edge detection is one of the first things it does.

So the banding is not a fault in the generation. It is the file format meeting content that exposes it.

The two things that actually help

Everything you can do about banding comes down to how many distinct levels the ramp gets to use.

More color distance. A ramp from deep indigo to bright pink traverses far more levels than a ramp from one gray to a slightly different gray. More levels across the same width means narrower bands, and once a band is a couple of pixels wide it stops being visible. This is why bold gradients look clean and subtle ones look striped.

Less distance to cover. The same color change across a narrow strip bands much less than across a full frame, because the same number of levels is packed into fewer pixels.

There is a third option that belongs in an editor rather than here, which is to lay fine noise over the gradient. It replaces the hard step with random variation, and the eye reads grain much more forgivingly than it reads an edge. If a subtle ramp is a requirement, that is the professional answer.

Where it will show

Check on the largest screen you have, at one hundred percent, before deciding a gradient is clean.

Phones hide banding almost completely — the pixels are small, the screen is dim relative to a desk monitor, and the whole image is scaled down. The same file on a large display shows the stripes plainly, and print shows them worse still, because paper has no backlight to wash out a subtle edge.

The failure mode is approving a gradient on the device you made it on and discovering it on the device somebody else opened it on.

Publication gate

This page ships once the workflow has been run with a high contrast color pair, a low contrast pair, a very wide frame, and a subject with fine hair against the ramp, with each output inspected at full size on a calibrated display for visible banding.

Examples

Portrait for a title card

speaker.jpg - 2000x2600, busy office behind the subject
prathom-gradient-background.png - 2000x2600

The intended case. A strong color change across the frame gives the ramp plenty of steps and keeps the banding below the visible threshold.

Product on a subtle ramp

watch.jpg - 2400x1600, two similar grays requested
watch-gradient.png - 2400x1600

Bands. A slow change between close colors spreads very few distinct values across a wide area, which is the worst case for eight bit output.

Frequently asked questions

What causes the stripes in a gradient?

Eight bits per channel gives two hundred and fifty six possible values. Spread a change of twenty values across two thousand pixels and each value has to occupy a hundred pixels, so the picture contains a hundred pixel wide stripe of one color, then a hard step, then another. The steps were always there — a gradient just has nothing to disguise them.

How do I avoid banding?

Increase the color distance or decrease the area. Two strongly different colors across a frame use many more steps than two similar ones, so each band is narrower and falls below what the eye resolves. Failing that, add fine noise over the gradient in an editor, which trades a visible edge for invisible grain.

Does it change my subject?

No. A segmentation model produces the matte and your original pixels are composited through it, with no generative model in the chain at all. The subject in the output is the subject you uploaded, so this is safe for product photography and for headshots that must stay accurate.

Are gradient backgrounds a good idea?

They date faster than almost any other visual choice. A specific gradient reads as a specific era within a few years, which is fine for a talk slide or a campaign and worth thinking about for anything that will sit on a website for a decade. A plain sweep ages considerably better.

Is the AI Gradient Background tool free, and do I need an account?

There is no paid tier for Gradient Background, which means there is no free version being held back against one. You do not sign in, you do not enter a card, and the file you download carries no mark. What the page does ask of you is patience with the queue, because the job runs on a shared GPU host and finishes in its own time.