Kylie's CS151 Project 5

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

The purpose of this project was to write a code that takes a list that defines a collage and create that image. The code also allows for an alpha blend of the images in the collage.

The first task was to create a function called buildCollage that takes six parameters, for each image, in a list and builds a collage from them.  The function uses alpha blends to blend the colors of the images. I did this by assigning variables to each of the items in the list and then using if/elif statements to apply each of my filter.

The second task was to create a placePixmapNoBkg function that places the picture of me we took in lab into the collage, but without the background. I did this by setting the green values above a certain number to the pixels of the background.

The third task was to add another parameter to the build collage list. I did this by using an if statement that takes a True or False parameter from the list and calls the placePixmap function if the parameter is False and the placePixmapNoBkg if the parameter is True.

The fourth task was to create a collage that contains at least 5 images by writing a list and then calling the readImage and buildCollage functions.  My collage is pictured below.

The fifth task was to create a cover photo collage appropriate for a Facebook cover photo. I created a list using the same parameters as I did for my first collage, however, I changed the first variable in each element of the list to be an input from the command line in the terminal.  My cover photo is pictured below. 

For my first extension, I created a parameter that allows for a blue or green background to be eliminated when the placePixmapNoBkg function is called.  I assigned the gb parameter to the 7th item in the list and then used an if/elif statement (pictured below) to set the background to the pixels of the image behind it.

For my second extension, I created two new filters that make stripes in the photos. The second new filter I created makes stripes only in the background of a green screen picture.

By doing this ?project, I learned how to add additional parameters to my placePixmap function as well as how to use alpha blends to make a collage.

I got help from Bruce and Sara Hoffman on this project. I worked with Hannah Bossi, Chloe Boehm, and Sam Krumholz on this project.