Assignment 1

The first part of our assignment was to create a visual representation of a Julia set and then a Mandelbrot set. The way we did this was to run the given equations in our programs and then assign a color value based on wheter or not the equation broke our given threshold of 100. In the mandelbrot program we have the user input the scale of the real and imaginary axis in the programs arguments as well as the dimensions of the image. These arguments were then used to get the deltax and deltay values which were inturn used to calculate the real and imaginary values for the complex number c in the mandlebrot equations. the other integral part of the equation was the complex number z, for which we initially set at 0. If the pixel was an infinity attractor in the Mandelbrot program, we colored it by making the colors equal to the value of the pixel that of the number of iterations performed thus far multiplied by the quotient of 255 and the total number of iterations to be performed. If the pixel was a zero attractor it remained black. The functions was only iterated through 24 times.

Click to see the Mandlebrot image.

For the Julia Set we just made c constant and where the z values the variable, we did this by adding two arguments to the program for the constant c values. Where the c values where passed into the Madlebrot function we set those values to the real and imaginary z starting values in Julia. The zero attractor starts at white and each iteration gets closer and closer to the zero atractor, which is a blackish blue color. We went through 127 iterations when rendering the Julia set.

Here is what came of that.

For the Bluescreen assignment we calculated the mean and standard deviation in the RGB values from the upper right hand corner of the the picture. We did this under the assumption that this would be representative of the blue for the rest of the background of the image. We then passed the entire foreground picture through a boolean function to determine if the blue was within the standard deviation range. If it was outside of the range, then the pixel was copied onto the backround image in the place of our choosing. We did that by simply choosing where to start copying the foreground image on the background.

Alex's initial photo.

Don't get Alex angry.

You wouldn't like him when he's angry...

Responses to Questions:

1. The picture of Alex is 486 pixels wide and 557 pixels high. We found this by opening it in GIMP and pulling up Image Information. This is after we blurred and scaled the image down from its original size of 1944x2592 pixels. readPPM also returns this information as the first and second args passed by reference.

2. The origin of an image is the top lefthand corner of that image. Pixel (0,0) is the topleft pixel in the image, not (1,1). This means that increasing the y-coordinate in the xy-plane means decreasing the row number to be written. We knew this from previous experience with images, but we confirmed it by placing the bluescreen image in different locations on the background.

3. By middle-clicking on an image, details about the pixel under the mouse show up at the bottom of the window. These details include the coordinates, which are also measured from the topleft corner.

4. First, a square in the corner of one of the bluescreen images was analyzed for mean RGB values and standard deviation. Then, blue pixels are found by determining the distance in RGB-space from the current pixel to the mean found earlier. This effectively creates a sphere in RGB-space centered at a determined blue value. The problem with this though is that when we attempted to use a different picture with significantly different RGB values and blue clothing the mean we calculated from the first picture no longer applied to the second picture, resulting in some missing pixels with the second picture. While it may not be necessarily better, one way we did it earlier was just by creating general threshold values for all three RGB values. When we made them fairly general enough,we were able to theoretically make both pictures work, although we never tried it on both.

5. How did you creatively insert yourself in an image? For this question, write down the equations you used. We placed multiple copies of the foreground image at different locations within the image, using an offset for the position of the top-lefthand corner. We also scaled the foreground image using the following algorithm:

allocate scaled image with size ((source image height) *
(percentage), (source image width) * (percentage))

for i = 0 to (scaled image height) do:
   for j = 0 to (scaled image width) do:
       scaled image(j, i) <- source image(j / percentage, i / percentage);
   end;
end;
This methodically gets the pixel value for each pixel in the scaled image from the corresponding location in the original image. We also flipped the image both horizontally and vertically.

6. Easily the most interesting part of the the mandlebrot was playing around with the c values in the Julia sets within it. The variation that was provided by this was very intersting to see. So It was very interesting to see the individual parts of the mandlebrot as we changed the c values around and shifted along the real and imaginary axis.

7. We started out with fairly simple color schemes with our zero attractor being black and watching the variation in only the green values through each iteration. Once we were in the Julia sets, we started to experiment with different values doing different things through each iteration. We also played with different zero attractors, although we ended up deciding that white looked pretty awesome and used that more often than not with our varying infinity attractors.

Portfolio Images

Julia-2.png

Julia-3.png