top of page

RANDOM ART

Responsible for coding script.

Python.png

This program is designed to create "random art" by manipulating strings, it can also rename files within a folder. There is a main menu where the user is able to choose from three different tasks to run, the first is generating random strings with math functions in them to create random art images, the second one recreates images from expressions previously saved in a text file, and the third option is to rename the png files within a folder. The images can be viewed with SideFX mplay.

Creating new images

For the first option, when generating new images, the program randomizes a list of math functions including sine, cosine and the square root, a list of operators and a list of variables. With those values it creates a string using recursion, resulting in a complex expression. The random expressions are later assigned to the value of the red, green and blue for colored images or just assignes to the value of the intensity if it is creating grayscale images.

 

The program lets the user choose the folder where to export the images, the file name, the amount of images and the level of recursion.

 

When the images are saved in the right folders, the program asks the user if he wants to save the information of an image to be able to recreate it later. What it does is that it saves the expressions that created the image into a text file, saving three expressions for the colored images or just one expression for the grayscale images in one line for every image saved.

Recreating images from text file

The second option reads a text file where some expressions have been stored and depending on the type of image (grayscale or color), it assigns the corresponding expression to each value (red, green, blue or intensity) so that the program can plot the images again. It lets the user choose the path where the images will be saved and the text file where the expressions are located.

 

If the output folder already contains some other images, it appends the recreated ones without erasing or overwriting the ones that were already there.

Renaming files in a folder

The last option can rename the image files that exist within a folder for better organization. The folder should be in the same location as the script.

bottom of page