Tired of always seeing the same desktop wallpaper, in March of 2020 I set out to program a way to see a new desktop wallpaper every time I looked. I soon discovered how I could use Blender, a 3D graphics engine, with a scripting API to create 3D renderings using only Python.
Using Blender, I attempted to automate the process of creating visually appealing background images. The idea was to use an automated process to create several similar, yet unique images to use in a slideshow as my desktop wallpaper. By using a slideshow of similar images, I was able to create a desktop wallpaper that changed enough to seem new but didn't change so severely as to be a visual distraction.
I soon settled for a design of cubes floating and casting shadows over a three-colour gradient.
An example output image
The 3D structure was fairly straightforward. First, I created a plane with a three-colour gradient using linear interpolation (AKA lerp) for my background. I then generated a variable number of cubes in random positions with colours matching their position over the background gradient. The cubes were placed with a minimum distance between them so there would be no 3D-overlap. The scene was then rendered and ready to be used as a desktop wallpaper.
This process was then repeated a number of times, each time with a new set of cube positions. The images could then be displayed as a slideshow.
Notice the minimum distance between cubes
Having a wallpaper change between two similar images prevents significant visual distraction
Furthermore, the scene was completely customizable with easily adjustable variables controlling gradient colours, number and size of cubes, minimum space between cubes, output resolution, and output image compression.
The settings I used:
# RGB Colors for gradientCOLOR_1=(78/255,220/255,77/255,1)# LeftCOLOR_2=(231/255,55/255,82/255,1)# MiddleCOLOR_3=(50/255,107/255,222/255,1)# RightRENDER_COUNT=150# Total number of image generationsMAX_CUBE_COUNT=60# Total number of cubesMAX_ITERATIONS=2500# Max iterations for cube generation loopBUFFER=0.25# Buffer size around cubeSIZE=0.8# Size of cube# Screen resolution and resolution qualitybpy.context.scene.render.resolution_x=1920bpy.context.scene.render.resolution_y=1080bpy.context.scene.render.resolution_percentage=60
Using different colours
The source code for this project as well as many rendered images can be found on (my Github page) (having problems adding hyperlinks, please see contact page for Github link).