Create Your Own Cinema Redux Poster with Ruby and RMagick
By John Berry on April 25th, 2008
A few years back, the talented Brendan Dawes created Cinema Redux, which 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. By arranging these stills into rows of 1 minute, you get an interesting overview of how a film flows from start to finish.
While there are still some prints available for sale - 2001: A Space Odyssey is available through Coudal Partners - I wanted to do my own. Here are a few:
![]()
Detail view of 2001: A Space Odyssey
What the Script Does
montage.rb has 2 major processes. First, it reads each of the rendered stills and resizes them to computed size (based on configuration options), and writes them to a subdirectory. Next, it reads in these scaled images into an RMagick ImageList - using the montage method - then writes the resulting file. The montage method would handle resizing for you, but the memory required to handle all frames from the movie at full resolution is prohibitively high. Manually scaling the images allows for more efficient memory management.
Step 0
Before you get started, you'll of course need RMagick 2 (and thus ImageMagick). While I'm sure you could hack the script to run with RMagick 1.x, I strongly advise you don't. RMagick 2 does a much better job of memory management, and supports the .destroy! method, allowing the script to free memory in the image resize loop. RMagick 1.x caused all sorts of problems for me early on.
Step 1: Download montage.rb
That's it, just download montage.rb. Well, then unzip it.
Step 2: Export The Movie as a Series of Stills
Create a new directory and place in it your movie and montage.rb. This next export step will create thousands of still images, so you might want to get a little organized.
If you don't have QuickTime Pro:
You'll need FFmpeg. The command you'll use will be similar to:
ffmpeg -i YOUR_MOVIE.avi -r 1 -f image2 movie_%4d.png
Once this is done, you can skip to Step 3.
If you do have QuickTime Pro:
Select "File -> Export..."
From the Export select menu, chose "Movie to Image Sequence"
Click the Options button, and use the following settings
(For these options, I chose Best Depth and Medium Quality)
Choose your target directory and save. This step will create those few thousand still images, so make sure you're putting them in the newly created directory.
Step 3: Choose montage.rb options
Run montage.rb without any arguments to get a listing of the usage options. The only required argument is the file pattern that will match against the movie stills.
What Now?
I went with QOOP as a printing service, and chose a 20" x 30" format. Some jpeg compression was in order to get the filesize below their threshold, but not much. The print is high quality and I'm quite pleased.
Note that if you're into Processing, you can find a sketch that appears to do similar work here.

Comments