Deborah R. Fowler
VSFX 160 - Random
Art
Posted on June 25 2018
Updated on March 17 2024
This assignment was designed from Nifty Assignments 2009 - Stanford Computer Science SIGCSE.
Random Art by Christopher A Stone - recursive nested random symbolic math expressions
http://nifty.stanford.edu/2009/stone-random-art/
The version you have been assigned is below:
Must have the PIL (Python Imaging Library)
The PIL library is easy to install. Instructions are on this page (including a short video)
THIS ASSIGNMENT MUST BE COMPLETED ON LINUX (The PIL library is not available on our Windows image but is available on Linux in Python 2.7, not 3.6)
Here are some of the examples I have generated
Goals:
Understanding file output, string manipulation and a start to graphics. The student will write a part of a program to create strings that will be evaluated to create "random art"
Requirements:
A skeleton file is included to set up the image. Your job is to create and evaluate the expressions.
Considerations:
For a step-by-step guide and hints see the class lecture notes here and here
For examples of recursion:
- SimpleStarterExample.py
- http://openbookproject.net/thinkcs/python/english3e/recursion.html
- http://interactivepython.org/runestone/static/pythonds/Recursion/pythondsintro-VisualizingRecursion.html
Possible extensions:
Once you have completed the image making process, things that
could be added to push your exercise further:
- print a corresponding txt file to record the string that created it
- add a function that could read in a txt file with the string output above and recreate the image
- allow input from a user to control levels (recursive or iterative), location of the resulting images, and/or name of the images
- provide a script that could be run at presentation to display your images by launching mplay (the image viewer associated with Houdini) with your images
- make your best images higher resolution
You are generating images. As an example of what you might do with this, I took a few of my images as a source for height fields in Houdini
Or textures. (black and white with displacement as well at https://vimeo.com/281088133)
Submission guidelines:
The project will be submitted to your dropbox in a folder (also called a directory) named:
S24_V160_EN_LastnameFirstname_Title/
The directory should contain the following:
- solution.py
- S24_V160_EN_LastnameFirstname.pdf or html (a brief description of information you would like to communicate. This document is to provide a user's guide noting any extra features you have added. In future, the pdf/html will provide a breakdown with your target audience being your peers.
- inside a subfolder "images" a selection (5-30) of .png
images labeled with S24_V160_EN_LastnameFirstname.00X.png where
X is the number of the image. (Hint - you can write a script to
rename these files)
Remember to test your file before handing it in!