Skip to content

Creative coding and optical illusions in Rust.

License

Notifications You must be signed in to change notification settings

infinity-creative/rusty_art

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 -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 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
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
imgabor.mp4
animated GABOR
munkerclock.mp4
Munker illusion
voronoi.mp4
Voronoi diagram
lorenz.mp4
Lorenz Attractor

About

Creative coding and optical illusions in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%