Rusty_Art ๐ ๐จ
Creative coding with Rust! ๐ฆ
In this repository, I will create animations and optical illusions that allow for the generation of various patterns in my spare time. So, this repo is consistently updated and current ๐
Most of my scripts feature a graphical user interface (GUI), enabling real-time adjustments to the animations and opening up the possibility to create thousands of unique patterns.
I hope you enjoy it!
๐ Usage/Installation:
This section is intended for those who are new to GitHub or Rust and may not be familiar with these tools.
1- Install Rust Programming Language
2- Click on the green "Code" button at the top right of this page. Then, select "Download ZIP" from the dropdown menu. After the ZIP file finishes downloading, extract it to a folder on your computer.
3- Open the terminal (also known as command prompt or cmd) on your computer. You can simply open it in the folder "rusty_art" by right-clicking on the folder and selecting "Open in Terminal".
To run the scripts, in the root directory of the project, type the commands in the following style.
```bash
cargo run --release --bin <filename>
```
That's it! If you encounter any issues while opening/running scripts, feel free to contact me. ๐
Saving Frames ๐ธ
To create high-resolution videos, you can save each frame as a PNG image by holding down the spacebar while the script is running. This will save each frame in a folder called "frames" which will be created automatically in your current directory.
Once you've saved all the frames you want, you can create a video file by copying the images to a folder and running the following command in that folder:
```bash
ffmpeg -r 60 -f image2 -start_number 10000 -i %d.png -vf "scale=-2:990,format=yuv420p" -vcodec libx264 -crf 10 output.mp4
```
This command will use the images in the "frames" folder to create a video file named "output.mp4" in the same folder. The video will be encoded with the libx264 codec at a constant rate factor of 10 and with a pixel format of yuv420p. The frame rate will be set to 60 frames per second (-r 60).
Note: You need to install ffmpeg to create videos.
โ ๏ธ
Warning I only tested these scripts on my notebook with the following specs:
CPU: Ryzen 7 6800h Ram: DDR5 16GB GPU: Nvidia RTX 3060 mobile
And I must say that some of the scripts are very computationally intensive. So, if you have a relatively "low-end" computer, you may not be able to run some of the scripts smoothly. I'm sorry about that. ๐ And please don't run the scripts on your computer if you don't have a good cooling system. I don't want to be responsible for any damage to your computer. ๐
Always open if you have any suggestions or cheap tricks (in terms of computational complexity) to improve the performance of the scripts. ๐
Scripts that are computationally intensive (in my opinion):
- peace2 and peace3
- mandelbrot
- pixelrain
- attractors
- gabor
๐ผ๏ธ Some Examples:
attractors.mp4 |
neuralnetwork.mp4 |
chladni.mp4 |
hole.mp4 |
GABOR.mp4 |
hilbert.mp4 |
rain.mp4 |
peace2.mp4 |
cafewall.mp4 |
fourier.mp4 |
pdiamond.mp4 |
ferris.mp4 |
hilbertimg.mp4 |
waves2.mp4 |
munker.mp4 |
leviant.mp4 |
snowflake.mp4 |
noiseb.mp4 |
triangles.mp4 |
pixelrain.mp4 |
peace2.mp4 |
attractor.mp4 |
fibonacci.mp4 |
imgblob.mp4 |
peace.mp4 |
pinna.mp4 |
mandelbrot.mp4 |
spiralimg.mp4 |
peace2.mp4 |
lilac.mp4 |
peace120.mp4 |
hole.mp4 |
attractors2.mp4 |
spiralimg.mp4 |
scramble.mp4 |
pixelate.mp4 |
rainbowimage.mp4 |
dfft.mp4 |
dfft.mp4 |
munkerclock.mp4 |
voronoi.mp4 |
lorenz.mp4 |
ULAM.mp4 |