Project 5: Dynamic Collages
With this assignment, we're continuing to work on lists, files, and general coding skills.
Create a function collageReadImages that takes in a list of lists (the
output of collageReadFile()), reads the image files into memory and
appends the picture object to the end of each list. Essentially, you are
creating a function to do a piece of the main2() function from the lab.
def collageReadImages( collage ): # for each parameterlist in collage # make a picture from the filename # append the picture to the end of the parameterlist
Create a function collageBuild() that takes in a collage list,
generates the collage and returns it. the function needs to execute
the following steps.
def collageBuildImage( collage ): # calculate the appropriate width and height for the background # make the background image # for each parameterlist in collage # call the imageCopyInto() function with the parameterlist and background # return the background image
- Add a main program that lets the user pick a collage file, calls collageReadImages(), then collageBuildImage(), shows the collage, and uses the JES writePictureTo() fuction to write out the image to file.
- Implement mirroring and matting using the parameters we defined as part of the image information list.
- Have the computer automatically create many different collages from a single set of images using different effects and orderings. Make use of the random.shuffle() method that shuffles the elements of a list.
- Add more parameters to your image descriptor. For example add a string that gets put at the top of the image after it's been pasted into the collage. Get creative about making use of additional parameters to allow customization of your collage by editing the collage text file.
- Make use of many different images and the parameter choices to get creative with your collage.
Hand in your code for this assignment using the Moodle drop box. There will be a drop box for each week's assignment. Hand in your python code file. If there are any specific images required for your system to work, zip them up with your code file.
In the unlikely (we hope) event that Moodle is down when you need to hand in your assignment, please email the python file to Professor Maxwell.
Please do not place code anywhere public. Do not include it in your writeups on the wiki, for example.
Each of you should create your own wiki page for your writeup. The writeup can be brief, but should include the following components.
- A brief abstract (200 words or less) describing the project.
- A more detailed description of what you did. This week, focus on your use of lists and loops to make the code more flexible and efficient. Also, describe how you make use of files.
- Include any images or other output your program created. For this project, include a picture of your collage(s).
- Describe any extensions you implemented and show results for them.
- Give a brief (1 paragraph) description of what you learned.
Please put the label cs151s09proj5 on your writeup page (down below the editing window on the edit tab). Please make sure you type the label exactly as given above.