FORM+CODE in Design, Art, and Architecture

Transform: SLIT-SCAN

Slitscanning is a process for transforming the frames of a video into a single image. Slitscans can produce a variety of interesting visual effects and, depending on the source, can often reveal interesting patterns in the source video.

This example works with a movie file or webcam to supply a continuous feed of images. For each image read from the movie file or camera, only one row of pixels is used (the rest are ignored). New slices are added to the right, while older slices shift to the left and are automatically deleted when they reach the edge of the screen.

/** * Transform: Slit-Scan * from Form+Code in Design, Art, and Architecture * by Casey Reas, Chandler McWilliams, and LUST * Princeton Architectural Press, 2010 * ISBN 9781568989372 * * This code was written for Processing 1.2+ * Get Processing at */ import*; Movie myVideo; int video_width = 768; int video_height = 576; int video_slice_x = video_width/2; int window_width = 1000; int window_height = video_height; int draw_position_x = 0; boolean newFrame = false; void setup() {   myVideo = new Movie(this, "");   size(window_width, window_height, P2D);   background(0);   myVideo.loop(); } void movieEvent(Movie myMovie) {;   newFrame = true; } void draw() {   if (newFrame) {     loadPixels();     for (int y=0; y<window_height; y++){       int setPixelIndex = y*window_width + draw_position_x;       int getPixelIndex = y*video_width + video_slice_x;       pixels[setPixelIndex] = myVideo.pixels[getPixelIndex];     }     updatePixels();          draw_position_x++;     if (draw_position_x >= window_width) {       exit();     }     newFrame = false;   } }

Contributed Examples


We are looking for implementations of the code examples in other programming languages to post on the site. If you would like to submit a sample, or if you find a bug, please write to