Generative Art - Assignment eight

Due: 2014-01-20 10:30a

Important: Because all of these require a resource (i.e., an image), submit your whole sketch directory and not just the .pde file. You can zip it if you like, or just drag the whole directory into the DROPBOX, either will work.

Objectives

[10 points] Sepia toning

For the first part of the assignment, you are going to apply sepia toning to an image. This is a very common image filter that you will find in just about every phone app for taking pictures and processing them. Here is an example:

Assignment8a

This effect is actually fairly easy to achieve. Sepia tone is not a color photograph, it is a black and white photo that is colored. This is meant to emulate very old photographs that came out, well, sepia, because of the nature of the processing.

If we start from the black and white image, we can make it sepia by adjusting the values of the red and blue channels. Now, if we were to just globally adjust the red and blue channel, we would basically be tinting the image. This can look close to sepia, but it won’t have the same look. Instead, we are going to break the image down into three “zones”: the highs, the mids, and the lows (basically, the bright regions, the average regions, and the dark regions, if you prefer). These zones are defined by the luminance of the pixel. The following table lists the luminance values we will associate with the three zones as well as the weights we will use for the red and blue channel.

Type Range of values Red weight Blue weight
shadow 0-62 1.1 0.9
mid 63-192 1.15 0.85
high 193-255 1.08 0.93

Process

Here is an example: Let’s say that you have a pixel that has the RGB values of (200, 100, 80). You compute the luminance: (200+100+80)/3 = 127 (roughly). 127 puts this in the mid zone, so our red weight is 1.15 and the blue weight is 0.85. Our new red value is 1271.15, which is approximately 146. Similarly, our new blue value is 1270.85, which is approximately 108. So, our final color is (146,127,108).

In essence, this just means that you have a conditional statement to write. The only gotcha in here is the red value. When we are in the highs, we are multiplying by more than 1, which means that the final value for the red can be more than 255. This is undesirable. So, you either need to write another if statement that checks if the red channel is more than 255 and turn it back down again, or you need to check out the constrain function.

Naming your sketch

I would like you to name the sketch using this pattern: username_hw8a.

Take a picture

Submit at least one sepia toned image and name it using the pattern username_hw8a-####.png.

[10 points] Kaleidoscope

Like the above, this is a variant of something we did in class. In class, I showed you how to mirror an image across the center of the image. I want you to take this one step further and split the image into quarters, all mirror images of each other across the center.

Instead of visiting half of the pixels and mirroring them across the center line, I want you to just iterate over the upper left hand quarter of the image. Flip the quarter across the center line like we did before (stop at this point and make sure the flip is still working). Then calculate where the point should show up on the lower left and set that one as well. Once you have that working, calculate out the corresponding point on the lower right and set that as well.

Assignment8b

Naming your sketch

I would like you to name the sketch using this pattern: username_hw8b.

Take a picture

Submit at least one kaleidoscope image and name it using the pattern username_hw8b-####.png.

[Bonus: +15 points]

Figure out how to make a real kaleidoscope and draw a circle (or regular polygon), with a wedge of the original photo repeating all of the way around.

[10 points] Flow the picture

Return to assignment 6. Find a way to map the location of the agent to a location in some source image. Use this to set the color of the agent’s line. This will look best if the canvas size matches the aspect ratio of the original picture.

Assignment8c 1

Have some fun with this. Try just using the brightness instead of the color. Or use some aspect of the pixel color to change the behavior of the agent. Change its angle, or pick a different noise layer. Just play and see if you get anything interesting.

Assignment8c 2

Naming your sketch

I would like you to name the sketch using this pattern: username_hw8c.

Take a picture

Submit at least one image and name it using the pattern username_hw8c-####.png.

Documentation

Don’t forget the documentation block below at the top of your sketch. Make sure that you specify what you did that was cool and interesting.

/**
Assignment Eight

A description of the sketch.

Your name
The date
**/

Turning in your work

I would like this code turned in in the DROPBOX on MiddFiles. You can refer to the reference on the LIS wiki to help you connect to the file server.