Assignment 4
Skip to end of metadata
Go to start of metadata
Task 1

Task 1 is to create a function putPixmap which takes four arguments. The purpose of this function is to put a small pixmap onto another bigger pixmap.

The code is as below:

Task 2

This task is to create 3 mor functions like swapRedBlue that edit the colors in a Pixmap. I have created a few more, and for the picture of it, please refer to extensions

Task 3

This task is to put 4 copies of the smaller Pixmap and put it into the bigger Pixmap. For this task, I have done some more extensions on it, so please refer to extensions


I am changing the blue screen behind my picture into another color. I have divided it into 4 quadrants, and changed its color. The picture produced:


I have undertook a few of the extensions unconsciously, I was excited to create several effects. One of them is putting myself onto a scene. I chose to put myself by the beach:
Also, I went on to create a bigger Warhol style collage, and also enable my Warhol program to read in multiple images from the command line.

The command is:

This essentially allows people to put different images onto the Warhol collage.

My collage:
I placed the beach in the middle of the collage, and did some alternation. I then placed myself surrounding the beach. One special picture is the most lower-right. I have half of myself, with different effects, and it spiral down till it is very small.


I have learned to make wonderful effects to a picture by writing simple codes. I also learned that sometimes it is hard to actually make an effect work, due to the positioning and the colors of the pixels. Finally, I learned how to put myself onto any scene, given a simple colored background.