Project 4 The Warhol Project

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 create functions that would manipulate pixels of an image to create interesting effects on that image. Then, using these different functions I created a Warhol collage of the same photo with different effects on that image. The last major task of this assignment was to create a python program that would take the blue-screen image and turn the blue pixels into a different color.

I played around with the r,g,b values of each pixel to create a new and interesting images. For instance, I had a function that would make the image look like a negative print by subtracting all r, g, b values from 255. 255 is used because all r, g, b values are on a scale of 0 to 255.

I created a few other unique functions using similar manipulations of the r, g, b values.

Then, I created a Warhol collage by cloning my pmap (my Pixmap that I assigned to be the image of myself). I cloned this image 4 times and then called different functions to executeon the four cloned maps. For example, this is how I cloned the pmap the first time and then called the MakeNegative function on it.


I, then, created a new Pixmap that was doubly wide and double the height of the original 'pmap' because I want all four cloned pmaps to fit in this new Pixmap. Each cloned map will fit into a quadrant of the new Pixmap. 

Completing the last task of this project was the most difficult for me to figure out how to use the nested for loops and if statement within the noBlue function. 

This snippet of code shows the if statement I used to assign b to a value of 'very blue' when it was greater than the green channel and 1.5 times the red channel. If the pixel had a blue channel with these stipulations, then the blue channel was switched to a value of 0. The resulting image showed no blue pixels.


I created several different functions including a creepy red image with red channel pixels, a function that draws on random integers for the red channel and creates a pink fuzzy image. I then put together some of these functions in a Warhol collage done with a 3x3 size.

What I learned:

I learned how a Pixmap can be used and how fun it is to manipulate images using Python. I didn't realize that r,g,b values were on a scale of 0-255, so playing around with the values to make a negative image was very interesting to learn. When making my Warhol collages, I also learned how the coordinate system is used in Python. I didn't know that the 0,0 point starts in the top right corner of the Pixmap.