The purpose of Project 4 was to change the pixel colors in order to form multiple pictures of the same image with different filters. These first task before adding the filters was to make a placePixmap function that called the image twice. In order to do this I called for python to loop over the height and the width of the picture and used getHeight and getWidth commands to figure these amounts simply. The next task was to create three more functions like swapRedBlue. To accomplish this task I divided and/or replaced some of the rgb values. The three functions I created were veryPurple, veryGreen, and veryRed as can be seen below.
The next task was to take the 4 copies of the image and place them in one pixmap. I did this by creating a new file, warhol.py, that imported the filter.py file and called it and the images (called as maps) at different locations. To call the images at different locations I used the getHeight and getWidth commands. This image can be seen below.
The final task was to take our blue-screen image and change the blue pixels to another color. In order to do this I used an if statement that changed the pixels that were more blue than the red and green pixels by a certain amount to another color. Below is an image of the final product.
I completed three simple extensions where I placed the warhol pictures in shapes other than a square. In the first extension I manipulated the locations of the images in order to create a diagonal.
In the second extension I added four more maps and called the images at different locations in order to create two diagonals. This function also made a square in the middle.
For the third extension I added four more maps and called the images at different locations to create a border.
To complete this project I learned how to rearrange images within a function and how to use the getHeight and getWidth commands. I also learned how to change the color of pixels with and without if statements, and how to convert images to ppm files.
List of people I worked with