Blog
Skip to end of metadata
Go to start of metadata

Summary:

For our fourth project, our task was to use pixmap to manipulate the pixels to create different color schemes that we wanted. We then positioned them to be in the place that we wanted the pictures to be.

Our first task was to create a placePixmap function. With this function, we made sure that the all the pixels in the length and height would be manipulated and told the program where we wanted the pictures. The code for this looked like this: 

Next, I created different functions that would change the color of my image of miller. I changed around the r,g,b order as well as the numbers associated with them. In the r,g,b scale, we can use the numbers 0 through 255, with the color getting darker and closer to black the closer we got to 0. An example of the code that I wrote for these different color filters was:

After I created these three new filters, I now had my original picture of miller as well as three new filters to use. With these 4 different color filters, I made a warhol file that I would create a function in to make a warhol collage of four miller images with different effects. I made four copies of the pixmap using the clone function and named them map1,map2,map3, and map4. After doing this, I assigned a designated filter to each of the maps. For example, to assign my swapRedBlue effect to map1, I would write the code: filter.swapRedBlue(map1). After doing this, I created a new pixmap that was 2 by 2 by writing the code: 

Now I was able to place each picture of miller into the new 2 by 2 pixmap by using code:

This told the program to place map1 at the origin 0,0. I placed them in different places so they would come out in a square. This is what resulted:

Next, I created a conditional statement to change the green pixels from the screen, since we took a picture infront of the green screen, and change them to a different color if they were categorized as "very green". The code for this looked like such:

I used the conditional statement saying that if the green color was greater than or equal to 1.5times the red, and the green was greater than blue, to change the (r,g,b) values to (10,20,60). This changed the green screen, which was "very green" to a navy blue as shown below:

For my first extension, I created a filter that did something cooler than just replacing the green screen with a single color when it was "very green". In order to do this, I used the random function to assign random pixel colors in different ranges for the r,g,b values. The new, interesting green screen replacement I got was this:

The second extension that I did was to create some more filters, and then use the filters that I had to create a second warhol collage that was more complex and not in just a square shape like the first one. I drew out a 5 by 5 block and figured out which boxes would have a miller image with a filter so that they would be alternating, similar to how a chess board is. The 5 by 5 could not show the full thing on the screen, but I got enough to have it show and look like how I wanted it to.

What I learned: In this project, I learned how to use pixmaps and change the pixels in an image to change the colors and create cool effects. I also learned how to position photos on the pixmap where I wanted them to go. Additionally, I learned more about how to call different things better and became more comfortable using the conditional statements.

extension 3:

For my third extension, I placed myself in a scene that took all of the green screen and replaced it with the picture of the forest I was using. The code that I used for this was:

The final image that I got with me in the forest was this:

I worked with: Professor Taylor and Luc Marrie

Labels
  • No labels