CSS Gradient to Image
Render a CSS gradient as a downloadable image.
#22d3ee#7c3aedDimensions are clamped between 16 and 4096 pixels.
Preview is scaled to fit — the exported PNG is the full 1200 × 630 pixels.
background: linear-gradient(90deg, #22d3ee 0%, #7c3aed 100%);How to use CSS Gradient to Image
What this tool does
This tool builds a CSS gradient visually and turns it into a raster image you
can download. You choose a linear or radial gradient, set the angle for
linear ones, and add as many color stops as you like — each with its own
color and position. A live <canvas> preview updates as you work, drawn with
the browser’s createLinearGradient and createRadialGradient. When you are
happy, export the result as a PNG at the dimensions you need, and copy the
equivalent CSS background value to use directly in a stylesheet.
Why you might need it
A CSS gradient is perfect inside a web page, but plenty of places cannot run
CSS. Social share images, email backgrounds, slide decks, app splash screens,
placeholder artwork, and design mockups all need an actual image file. Rebuilding
a gradient by hand in an image editor is fiddly and rarely matches the CSS
version exactly. This tool closes that gap: design the gradient once, and walk
away with both a pixel-accurate PNG and the CSS string that produces the same
result. The size presets cover the most common targets — 1920 × 1080 for
wallpapers and slides, 1200 × 630 for Open Graph share cards, and 800 × 800
for square thumbnails — and custom dimensions handle everything else.
How to use it
- Pick Linear or Radial as the gradient type.
- For a linear gradient, drag the Angle slider —
0°points up,90°points right. - Adjust each color stop: click the color swatch to change its color, and drag the slider to move its position.
- Use Add color stop for multi-color blends, or Remove to delete one (a gradient always keeps at least two).
- Choose an output size — a preset, or type custom width and height.
- Check the live preview, then click Download PNG to save the image.
- Copy the CSS background string if you also want the gradient in code.
Common pitfalls
The most common mistake is expecting the on-screen preview to be full size — it
is scaled to fit the page, but the exported PNG is always the exact pixel
dimensions you set, so a 1920 × 1080 export really is that large. Another is
overlapping stop positions: if two stops sit at the same percentage you get a
hard edge rather than a blend, which is sometimes intentional and sometimes a
surprise. Very large dimensions produce big files and use more memory, so the
tool caps width and height at 4096 pixels. Finally, remember that a radial
gradient here is centered and circular; if you need an off-center or elliptical
radial, the CSS string is the better starting point since CSS offers more
positioning options than a single exported image can capture.
Tips and advanced use
For social share cards, start from the 1200 × 630 preset — that is the size
most platforms expect, and getting it right avoids awkward cropping. When you
want a subtle background rather than a bold one, place your two stops close in
hue and lightness; a gentle shift reads as texture instead of a statement.
Multi-stop gradients can simulate effects like a sunset or a metallic sheen —
add three or four stops and nudge their positions until the bands feel right.
Keep the CSS string for any gradient that lives on a real web page, because CSS
scales to any element size for free and stays crisp on high-density displays;
reserve the PNG for fixed-size assets. And since the whole process — preview,
export and all — runs inside your browser, you can design backgrounds for
unreleased products or private mockups without anything leaving your device.
Frequently asked questions
What image format does the export use?
Why does the CSS angle look different from the canvas?
Can I use the CSS string and the image interchangeably?
Is my gradient or image uploaded anywhere?
How many color stops can I add?
Related tools
SVG to PNG
Convert SVG files into raster PNG images.
SVG Optimizer
Optimise and shrink SVG file size.
HEX to CSS Filter
Convert a HEX color into a CSS filter for recoloring SVGs.
CSS Specificity Calculator
Calculate the specificity of any CSS selector.
CSS Unit Converter
Convert between px, em, rem, and percentage units.
RGBA to HEX Converter
Convert RGBA colors into 8-digit HEX with alpha.