Tuesday, March 30, 2010

NAVAGATION

As you saw during the presentation, this process finds itself rooted in the analysis of light quality in a series of spaces depicted through a video found on YouTube.com. The first process that I found incredibly helpful, for those of you using stills from a video now or in the future, is the program ImageGrab.

http://paul.glagla.free.fr/imagegrab_en.htm

It can be run without installing and has a fairly easy interface. It allows still to be taken from any video uploaded to it. What made it even more useful is it allows you to set a time frame in which
it will take successive stills, 1sec, 2 sec, etc... This can be done using the the "intravalometer" which is located along the toolbar (looks like an alarm clock). I am sure processing will do this for you but for those who don't have the time to figure that out this program worked very well, allowing me to save 132 jpegs in a few seconds.

The code used in processing to create the image above allows processing to load an image and through a line that you select (the green line in the image) will take the color of every pixel along that line and use its value to color a line which is drawn along the bottom of the image. This procedure is basically taking a section cut through the image at this defined point. Within this code is also a command called POSTERIZE which allows you to select the number of colors in which the image is made from. Note: If for example you have a color image and choose say 3 colors to create the image, the program will use three of every color meaning three blues, three reds, three yellows, etc... With my specific project I diminished the screenshots to black and white before loading them.

CODE:

PImage test; int y = 0; void setup() { size (500,600); // Size of the image *Be sure to include space // for your image and the lines to be drawn
test = loadImage("Test2.jpg"); // "Insert the name of your image"
} void draw() { image(test,0,0); filter(POSTERIZE, 3
); // POSTERIZE, Insert number of colors to make // image out of this example shows 3
y = constrain(mouseY,0,499);
// Sets variable y constraints of a straight line
// line the width of the image *mouseY allows the //movement of the line to be dynamic according to //the mouses placement on the image in the y-direction
for (int i =0; i < style="color: rgb(192, 192, 192);">// Sets variable i used to later
// to move over one pixel at a time until edge of // of the image is reache
d
color c = get(i,y); //get() function tells processing to "get" the // the color of each pixel using variables above
stroke(c); // Sets stroke color to the pixel recieved from above

line(i, 500,i, 600); // Tells where to
draw lines using the stroke color
}
stroke(57,221,44); // Gives the stroke color of the marking line on the image
// showing where the pixels are being selected in this case // a bright green
strokeWeight(2);

line(0,y,499,y);
}

Following is a screen shot with sections taken at 1, 20, 40, and 60 pixels




Wednesday, March 24, 2010

Cinema Redux

Vertigo (1958)



Created in January 2004, by Brendan Dawes Cinema Redux explores the idea of distilling a whole film down to one single image. This script lays out a film as a series of stills captured at 1 frame per second. The result is a matrix of images resembling a DNA print of the film.

Doing some internet sleuthing I was able to find a working script that allowed me to do the same thing. The original script created by Brendan Dawes was copyrighted and no longer works on new editions of Processing.

-------------------------------------------------------------------------------------

import processing.video.*;
Movie myMovie;
int xpos = 0;
int ypos = 0;
int VWIDTH = 11; // width of capture
int VHEIGHT = 6; // height of capture
int MOVIEWIDTH = VWIDTH * 60; // width is equivalent to 1 minute of film time
int MOVIEHEIGHT;
int MAXWIDTH = MOVIEWIDTH - VWIDTH;
float MOVIEDURATION;

void setup() {
myMovie = new Movie(this, "Tetsuo2.mov"); //change movie.mov to the filename of your Quicktime movie
MOVIEDURATION = (myMovie.duration()); // gets the duration of the movie in seconds
MOVIEHEIGHT = VHEIGHT * int(MOVIEDURATION / 60) + VHEIGHT; // height of the stage is based on the length of your film
// note that the last frame of the film will repeat until it reaches the end of the current line
size(MOVIEWIDTH, MOVIEHEIGHT);
background(0); // sets the background of the stage to black
frameRate(1); // forces the video to play at one frame per second
myMovie.play();
}

void draw() {
if(myMovie.available()) { // checks to see if the next frame is ready for processing
myMovie.read();
image(myMovie, xpos, ypos, VWIDTH, VHEIGHT);
xpos += VWIDTH;
if (xpos > MAXWIDTH) {
xpos = 0;
ypos += VHEIGHT;
}
if(ypos > MOVIEHEIGHT) {
saveFrame("my_movie_dna.tif"); // saves a tiff image to the folder of the current sketch when the end of the movie is reached
delay(2000); // pauses two seconds to save the file
noLoop(); // exits the draw loop so that the process ends
}
delay(100); // waits one tenth of a second before repeating the draw function
}
}

-------------------------------------------------------------------------------------

some notes:
  • To get this script to work you will need the video to have the file extension .MOV which is Apples QuickTime player format. If you have that you can just add the file in Processing by just dragging it into the script window. There a number of programs out there that can do this such as Oxelon Media Converter.
  • VWIDTH and VHEIGHT are measured in pixels this should probably be changed based on the ratio of the screen size of the movie.
  • It is also best to shrink down the size of the film in an exterior program (ex if the films screen resolution is 800x600 make it 80x60) this makes the computer do a lot less work and work faster to create the image.

Here are two I did.

Tetsuo: The Iron Man (1989)


2001: A Space Odyssey (1968)