CS 151: Project #5

Project 5: Dynamic Collages

Main course page

With this assignment, we're continuing to work on lists, files, and general coding skills.


  1. 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
  2. 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
  3. 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.


Code Handin

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.

  1. A brief abstract (200 words or less) describing the project.
  2. 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.
  3. Include any images or other output your program created. For this project, include a picture of your collage(s).
  4. Describe any extensions you implemented and show results for them.
  5. Give a brief (1 paragraph) description of what you learned.

Colby Wiki

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.