Gradient image maker — download a PNG and copy the CSS

Pick two colours (or three), choose linear or radial and an angle, and the tool draws a gradient PNG at the exact pixel size you need, plus the same gradient as one line of CSS.

Live demo · real result from this tool
Type

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use Gradient Image

  1. Set Width and Height in pixels (1–8000; the default is 1920 × 1080).
  2. Pick the Start colour and End colour. Tick Add a middle colour to set a third colour that sits exactly halfway.
  3. Choose Type: Linear or Radial. For Linear, set the Angle (0–360°, default 135°).
  4. The preview updates as you change settings. Download the PNG, or copy the line under The same gradient in CSS.

What it does and when to use it

Gradients are a popular background for slides, YouTube end screens, blog headers, social posts, phone wallpapers and app splash screens. Design apps can make them, but this tool gives you a file at an exact size in seconds, together with the CSS to reproduce it on a web page.

Typical sizes are 1920 × 1080 for slides and video, 1200 × 630 for link previews, 1080 × 1920 for stories and phone wallpapers, and 1500 × 500 for an X header. Put text on top with Image Text Overlay. For a plain fill, use Solid Color Image. For more CSS gradient options, such as many colour stops, the CSS Gradient Generator helps.

How it works

For every pixel, the tool works out how far along the gradient line it lies, as a number from 0 to 1, and mixes the two nearest colour stops in that proportion. The linear line has the CSS length, so the very corners reach the first and last colour. The radial version uses the distance from the centre divided by the distance to a corner. The image is encoded as PNG in your browser; nothing is uploaded.

Worked examples

Outputs from the tool’s own function.

A link-preview background. Width 1200, Height 630, default colours: a 1200 × 630 px PNG from indigo #6366f1 at the top left to pink #ec4899 at the bottom right, with the CSS background: linear-gradient(135deg, #6366f1, #ec4899);.

Three colours, left to right. Add a middle colour (default amber #f59e0b) and set Angle 90: the CSS becomes linear-gradient(90deg, #6366f1, #f59e0b, #ec4899).

A spotlight background. Type Radial, Start #ffffff, End #0f172a: white in the centre fading to near-black at the corners, radial-gradient(circle, #ffffff, #0f172a).

Limits and tips

  • Stops are evenly spaced; you cannot move the middle colour off centre here.
  • To shrink the PNG, convert it to WebP with the Image Converter.

Frequently asked questions

Which way does the angle point?
It follows CSS. 0° runs from bottom to top, 90° from left to right, 180° from top to bottom, and the default 135° from the top-left corner to the bottom-right.
Where does a radial gradient end?
It starts at the centre with the Start colour and reaches the End colour exactly at the corners, the same as CSS radial-gradient(circle, …) with its default size.
Why do I see faint bands in a large, subtle gradient?
A PNG stores 256 levels per colour channel. Stretching two close colours over thousands of pixels leaves wide steps between levels. Choose colours further apart or a smaller size to reduce it.
What is the largest image I can make?
Up to 8000 × 8000 px. Above 2400 px on a side, the gradient is drawn smaller with the same proportions and scaled up evenly, which keeps it fast and smooth without changing its angle.
Should I use the PNG or the CSS?
On a website, the CSS line is better because it adds no download and stays sharp at every screen size. Use the PNG for slides, video, documents, phone wallpapers and apps that cannot read CSS.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close