Turn the colors of a photo into a gradient, then fine-tune it and copy the CSS or save it as an image
Upload a photo to build a gradient from its colors
Image to Gradient finds the main colors of a photo and turns them into a gradient that runs the way the colors do in the photo: a sunset sky over the sand becomes a gradient from top to bottom. Choose 2 to 6 colors and a mood, tap the photo to take an exact color, change the type and angle, then copy the CSS or save the gradient as an image. Your photo never leaves your device.
Real Image to Gradient results. Drag the line to compare.

PhotoGradient
Upload or drop a photo, paste one with Ctrl+V, or try a sample. JPEG, PNG, WebP, GIF and HEIC all work.
Take 2 to 6 colors, and choose a mood to say which ones count: Colorful, Bright, Muted, Deep, Dark or all colors.
Tap a stop and then the photo to take an exact color, change the type or the angle, then copy the CSS or save an image.
The mood decides which pixels count. Colorful, the default, skips greys and very light or dark pixels; Bright, Muted, Deep and Dark look for those tones. If too few pixels fit, the tool uses all the colors and tells you.
Two colors give a simple blend; six follow the photo more closely. Each color is placed where it sits in the photo, at least a little apart from its neighbors.
The photo gives a linear gradient. Switch it to radial or conic, change the angle, or add colors up to 10, and the colors you took stay.
| Colors from the photo | 2 to 6, then up to 10 stops |
|---|---|
| Moods | Colorful, Bright, Muted, Deep, Dark or All Colors |
| Direction | Follows the colors in the photo, in steps of 45 degrees |
| CSS | A standard gradient after a solid fallback color, with no vendor prefixes |
| Image sizes | 1920 × 1080, 3840 × 2160, 1080 × 1080, 1080 × 1350, 1080 × 1920 and 1200 × 630 |
| Image formats | PNG, JPG, WebP or SVG (a conic gradient cannot be saved as SVG) |
| Price | Free, with no watermark and no sign-up |
| Photo formats | JPEG, PNG, WebP, GIF, HEIC and other images your browser opens |
| Where it runs | In your browser; nothing is uploaded |
Updated November 25, 2026
It shrinks a copy of the photo to 240 pixels on its longest side, groups the pixels by color, and finds the main colors with k-means clustering, counting only the pixels that fit the mood. Each stop is the average of one group, so it may not match any single pixel; tap the photo to set a stop to an exact pixel.
It looks at where each color sits in the photo. When they are spread out, the gradient runs between the two colors farthest apart, in steps of 45 degrees, and each stop sits where its color is. When the colors are mixed all over, it runs from light at the top to dark at the bottom.
Yes. The photo gives a linear gradient; switch the type to radial or conic and the colors stay. You can also change the angle, move the stops, and add colors up to 10.
JPG, PNG, WebP, GIF and BMP, and HEIC photos from an iPhone, which are converted in your browser. Photos with clear areas of color give the most striking gradients.
Copy the CSS, or save the gradient as an image: PNG, JPG, WebP or SVG, in six sizes from 1200 × 630 to 4K (3840 × 2160), for wallpapers, slides and social posts. The image is drawn with the same geometry as the CSS, so it matches the preview. SVG cannot hold a conic gradient, so a conic one saves as PNG, JPG or WebP.
No. The colors are found in your browser, so the photo never leaves your device.
Yes. Our terms allow personal and commercial use of the tool, and the saved image carries no watermark. If you make a gradient from a photo, make sure you may use that photo.