Wallpaper which smoothly changes colour from one to another

About a year ago, I wrote an article in Reddit’s r/kde group about a desktop wallpaper that changes color seamlessly from one color to another. I described it as a football field with the sky above it. I was asked for an example image. I couldn’t make one at the time.

I think KDE had an option for such a background in the system settings a couple of decades ago.

Now I did it with a python program. I still hope that KDE’s system settings will have a desktop background drop-down menu with this kind of seamless transition between two colors. You can choose the colors yourself. Why can’t the settings have vertical and horizontal color sliding.

Python code to do that:

#!/usr/bin/env python3
“”"
Generate a smooth vertical gradient wallpaper image.

Top of the image = light color (sky)
Bottom of the image = dark color (ground)

No text, icons, or objects are drawn on top - just a clean,
smoothly interpolated color gradient, ideal as a desktop wallpaper.
“”"

from PIL import Image

def make_gradient(
width: int,
height: int,
top_color: tuple[int, int, int],
bottom_color: tuple[int, int, int],
) → Image.Image:
“”“Create an image with a smooth linear gradient from top_color to bottom_color.”“”
img = Image.new(“RGB”, (width, height))
pixels = img.load()

r1, g1, b1 = top_color
r2, g2, b2 = bottom_color

# Precompute one row per y value, then copy it across the width.
# This is much faster than computing per-pixel.
for y in range(height):
    t = y / (height - 1)  # 0.0 at top, 1.0 at bottom
    r = round(r1 + (r2 - r1) * t)
    g = round(g1 + (g2 - g1) * t)
    b = round(b1 + (b2 - b1) * t)
    for x in range(width):
        pixels[x, y] = (r, g, b)

return img

if name == “main”:

Typical Full HD resolution; change to match your screen if needed.

WIDTH, HEIGHT = 1920, 1080

# Light sky blue at the top -> dark navy at the bottom.
TOP_COLOR = (176, 224, 255)     # light, airy sky blue
BOTTOM_COLOR = (10, 20, 45)     # deep dark navy

image = make_gradient(WIDTH, HEIGHT, TOP_COLOR, BOTTOM_COLOR)
output_path = "/mnt/user-data/outputs/gradient_wallpaper.png"
image.save(output_path)
print(f"Saved wallpaper to {output_path}")