A project for rendering wallpapers inspired by Neuro's Sclera and spiraling Sierpinski triangles.
This Project provides the code for rendering Sclera/Raymarch and a background with my interpretation of "a sort of Sierpinski spiral triangle".
It generates a .png wallpaper or a .mp4 Video.
You can customize layout, color, resolution and framerate.
-
Requirements
- Python 3.x (did not check for the minimum version, made with 3.14)
- git
- git lfs (if you want the example video and pictures)
-
Clone the repository:
git clone https://github.com/CrafterFB/NeuroBackground.git cd NeuroBackground -
Create a virtual python environment with
python -m venv venv
and activate it with
Windows:.\venv\Scripts\Activate.ps1
Linux/macOS:
source venv/bin/activate -
Install dependencies with:
pip install -r requirements.txt
-
Render an image:
python wallpaper.py
-
Render a video:
Warning: This will use 100% of your cpu.python video.py
-
Output will be saved in
NeuroBackground(the working directory) aswallpaper.pngandwallpaper.mp4. -
Cleanup files:
python clean.py
You can find fully rendered (1920x1080) files together with some other pictures in pictures.
You might need to install git-lfs [1] [2] or download them manually.
You can customize the image and rendering by editing settings.py
When you are experimenting with settings i recommend setting DEV to True for less costly resampling and less recursion.
Additionally you can run updater.py for checking if a file has been updated and automatically rendering the .png wallpaper.
Run
python screenSize.pyto get all screens and their sizes listed.
Then MONITOR_INDEX the index (left most number of every row) of the target screen.
Set MONITOR_SCALING to the largest scaling applied to any of your monitors.
Set MONITOR_OVERWRITE_WIDTH and MONITOR_OVERWRITE_HEIGHT to the target resolution.
The video will always render a full cycle. You can change:
START_OFFSET: change this if you want the video to start at a different point in the cycle. Should be between 0 and 1.RUNNLENGTH_SECONDS: how long a cycle will take, controls how fast the movement is.FPS: Frames per Second
I recommend setting RUNNLENGTH_SECONDS and FPS so that thy multiply to around 1800 because at slow speeds the changes are small enough that you wouldn't notice them unless you look for them.
If you want an alternative time curve or have linear time you can mess with the time calculations in the frameFunction. The final time passed to getWallpaper should range from 0 to 1.
SIZE_SPLIT_RATIO: The point at which the "Sierpinski triangle split" happens.ROTATION_OFFSET: The difference in time between flipped and non-flipped triangles.TRANSPARENT: Transparent color, don't change.BACKGROUND: Color of background.OUTLINE_SCLERA: The color of the outline of the triangles of sclera.SIERPINSKI_OUTLINE: The outline color of the Sierpinski triangles that are pointing up.SIERPINSKI_FLIP_OUTLINE: The outline color of the Sierpinski triangles that are pointing down.
You can change the layout of the Sierpinski triangles by modifying center and teeth in background.py.
For alignment markers uncomment the Draw calls in wallpaper.py.
center represents the formation in the center of the screen.
teeth represent the repeating formations going outward.
Both are mirrored vertically and teeth is mirrored horizontally and repeated. To change spacing and counts you need to modify the composeBackground function.
Both center and teeth are lists of tuples.
(0,0) of the wallpaper is in the center and a triangle positioned at (0,0) will have it's center at (0,0).
A triangle has a unit height and width of 1 and are positioned using those units.
The first value represents the x-offset from the screen center.
The second value represents the y-offest from the screen center.
The third value determines if the triangle should be flipped.
For experimenting it might be useful to optimize for performance for fast iteration.
- Set
MONITOR_OVERWRITE_WIDTHandMONITOR_OVERWRITE_HEIGHTto something smaller then your screen but the same aspect ratio. - Set
DEVto true. - Change
RUNNLENGTH_SECONDSandFPSso they multiply to around 600.
To avoid doing repeated work, some in-between images are cached as files in steps.
SKIP_SIERPINSKI_CACHE: Disable reading from and writing to cache specifically for the Sierpinski triangles. Set this to true while rendering video to avoid saving thousands of frames.SKIP_CACHE: Disable reading from and writing to cache.
See explanation.md for a explanation of the compositions and transformations used to render the wallpapers.
This project uses code created by Neuro, which was shown on stream, but is not released on Vedal's GitHub.
Until Vedal makes a statement about the licensing of code Neuro wrote, you should be cautious when using and redistributing this code.
With my code you can do whatever (MIT License).
The code copied from Vedal/Neuro is in the test folder and in sclera.py. But typically the entire projects is licensed as one.
This code is intended for personal purposes. Use at your own risk.
This project has fulfilled the purpose I gave it, which was creating a beautiful animated desktop for me.
I don't plan on developing it further and will not look at contributions to this project.
If you plan on adding to this project, fork it for yourself.
This project is only on GitHub so that I can share my wallpaper at 100% Quality, perfectly tailored to any screen or system.
