davehorner / rusty_art

Creative coding and optical illusions in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rusty_Art 🌈 🎨

Rust

227796857-e73c8e66-1446-4600-8018-aeaa6a59a4a4

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 -i %d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p 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 25 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 to improve the performance of the scripts. 😊

Scripts that are computationally intensive (in my opinion):

  • peace2 and peace3
  • mandelbrot
  • pixelrain
  • attractors
  • gabor
  • pixelrain

πŸ–ΌοΈ Some Examples:

attractors.mp4
Attractors
neuralnetwork.mp4
Neural Network Sim
chladni.mp4
Ernst Chladni's Plate Experiments
hole.mp4
Simplicity
GABOR.mp4
Gabor
hilbert.mp4
Hilbert
rain.mp4
Pixel Rain
peace2.mp4
Peace2
cafewall.mp4
Cafewall Illusion
fourier.mp4
Fourier Cycloids
pdiamond.mp4
Pink Diamond Doesn't Move!
ferris.mp4
Ferris <3 in Sine Wave Oscillations
hilbertimg.mp4
Hilbert Ferris
waves2.mp4
Sine-Waves From Night to Morning
munker.mp4
Munker Illusion
leviant.mp4
Leviathan's Enigma Illusion
snowflake.mp4
Snowflakes!
noiseb.mp4
How the Brain Processes Faces
triangles.mp4
Draw Not a Perfect Circle with Triangles
pixelrain.mp4
The Night Watch in Pixel Rain
peace2.mp4
Psychedelic
attractor.mp4
"Static" Attractors
fibonacci.mp4
Golden Ratio
imgblob.mp4
Sampling by Ellipses Based on Luminance
peace.mp4
Excited Polylines
pinna.mp4
Pinna Illusion
mandelbrot.mp4
Mandelbrot
spiralimg.mp4
Sampling Pixels by Luminance
peace2.mp4
Anatomy
lilac.mp4
Lilac Chaster Illusion
peace120.mp4
Flower
hole.mp4
Brain Gathering the Signals
attractors2.mp4
Attractors2
spiralimg.mp4
Converting Image Pixels into Hypnotic Spiral Line Thickness
scramble.mp4
Scramblery
pixelate.mp4
Scramblery2
rainbowimage.mp4
Sorting Pixels Based on Luminance
imfft.mp4
animated fourier

About

Creative coding and optical illusions in Rust.

License:Other


Languages

Language:Rust 100.0%