Random wallpapers

Random wallpapers

9 devlogs
10h 24m
Created by zakkbob

Randomly generate wallpapers using math stuff!

Repository

Timeline

Started working on a web version using WebAssembly and syscall/js
Going well so far!

Update attachment

Wrote a much better readme

hmmm, not really any good image to show here since the readme is too long. I guess another random image wouldn't hurt.

Update attachment

Refactored most of the code. So it's a lot simpler now.

Also changed the CLI arguments alot
- Wallpaper application is now optional (only happens if the --monitor flag is passed)
- The save location can be modified with the --output flag
- Custom seeds can now be added with the --seed flag

E.g two seeds could be added like this
[command_name] --output ./image.png --width 1920 --height 1080 --seed 0,0,0,105,148 --seed 1919,1079,148,17,0
And that would generate an image similar to the one shown below

Update attachment

Moved alot of settings into the CLI arguments

Seed Colour

The colour of the starting seed can be changed using the --sr, --sg, and --sb flags (Seperate channels)

Colour variability

The variability of each channel can be changed using the variability flags: --rv, --gv, and --bv. Variability controls how likely each channel is to change. So setting --rv to 0 would mean the red channel would remain the same as the seed

Update attachment

Turns out that wasn't too hard to fix. I just had to ignore pixels which had already been selected.

That brings the 800x800px image down from 3 seconds to 0.07 seconds (a 42x speedup) which hopefully means my code is only slow in linear time now

It also means i can generate full 1920x1080px images now. (Still takes 0.6 seconds, so there's much more room to improve)

Update attachment
zakkbob zakkbob about 2 months ago
Good idea, I’ll definitely try that. Thanks!
shurgbee shurgbee about 2 months ago
maybe look into adding some post processing effects like gaussian blur to make more cohesive

I updated the code so that the entire screen would be filled, not just as many as possible in 1000000 loops.

Also, I ran a small benchmark, and generating a 800x800px image and it takes a whole 3 seconds!!!

Here's why:
- Every iteration, a random coloured pixel is selected (the seed)
- Then, all its neighbors (which aren't already coloured) are coloured with a slightly modified version of the seed's colour

Do you see the problem?

There's nothing stopping a pixel being selected which is already surrounded by coloured pixels. This results in a LOT of wasted iterations, and the problem only increases exponentially as the image size increases!

Update attachment

Messed around with hyprpaper loading and unloading and now the wallpaper automatically gets applied

Update attachment

So i fixed a few bugs...
And it looks like this now, Yay!

Update attachment
zakkbob zakkbob about 2 months ago
Still REALLY slow though

Trying to figure out how to generate random images using a flood-fill algorithm

This is what it looks like so far... :(

Update attachment