Randomly generate wallpapers using math stuff!
Austin's SDK
Check their projects out: Austin's SDK Portfolio, Terminal Browser, Photo-previewer, Journly, SoM profile view tracker, Lockdown, WikiBeachia
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
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.
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
Moved alot of settings into the CLI arguments
The colour of the starting seed can be changed using the --sr, --sg, and --sb flags (Seperate channels)
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
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)
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!
Messed around with hyprpaper loading and unloading and now the wallpaper automatically gets applied
Trying to figure out how to generate random images using a flood-fill algorithm
This is what it looks like so far... :(