This project makes randomly generated .png images. It creates an expression
for each color channel, which it then runs with the x and y coordinates of each image pixel to determine the pixel's final color.
I'm super-glad you asked! It takes an x and y value and returns a new
value between -1.0 and 1.0. It nests functions to create unexpected values.
This image was created with the following expression:
sin(pi * sin(pi * sin(pi * (sin(pi * sin(pi * sin(pi * sin(pi *
cos(pi * y))))) * cos(pi * sin(pi * cos(pi *
avg(sin(pi * y), (x * x)))))))))You can look at random_art.py and edit it in order to change the expression generation process.
This project uses pipenv. To use it, download the project and run pipenv install.
Run create_art.py (using pipenv run or after you run pipenv shell). create_art.py takes several command-line parameters you may want to use.
-
--seed SEEDsets the random seed to a particular number. This is great for being able to generate the same image more than once. -
-s SIZEor--size SIZEsets the size of the image.SIZEis{width}x{height}, like2560x1600. -
-n NUMor--number NUMsets how many images to create.NUMis 1 by default. -
--gray,--rgb, and--cmykset whether the image is in grayscale or generated using RGB or CMYK values. RGB is the default.
Modified from a "nifty assignment" from the annual SIGCSE meeting.
