Digging up Muybridge

A plan for more zoetrope animation fun, and more bash scripting hacks

Spent most of saturday playing around with ancient animation footage.

Here's some of the results I created with the scripts I wrote to process old Muybridge plates from the 1870s...

Muybridge - Boxer blow with right hand Muybridge - Endless headspring loop Muybridge - Men having fun with each other naked Muybridge - The classic horse running loop Muybridge - Man Climbing Stairs

To complete my plan to construct a new kind of zoetrope design for the Curiosity exhibit on the 7th April, I needed some animation frames, and Eadward Muybridge is the classic creator of these things. I couldn't find too many of his original photographic zoo which had nice frame by frame animations.

The Objective

I decided to create some of my own composite animations from the photographic plates you can find online, like those shown below.

Original Muybridge Plate - man climbing stairs Original Muybridge Plate - men wrestling

Basically the material available in Muybridge's books is a whole photographic plate, often in multiple rows. These then need to be cropped into individual frames and composed into an animation to see if they work OK before spending a lot of time pasting them onto the zoetrope, or worse, making up stencils and spraying them on, which is likely to be the final presentation.

Given how many plates there are out there, and the manual overhead and likely errors of trying to do the cropping manually it was important to me to be able to automate this process. Now I can create the material easily, watch this space for some simulations of the zoetrope built in processing with these one-off Muybridge animations.

The Tools

I've been learning more and more about unix command line scripting for various purposes, and this seemed an obvious job for bash and imagemagick. I've used this combination previously to create whole websites, but the task this time was a little easier.

On the Mac, imagemagick can be picked up on the Mac through fink, or possibly darwinports. It's easy to grab on most flavours of unix. It provides the key operations like 'convert', and some other operations like 'identify' which would allow you to introspect the number of pixels etc. from the command line if necessary, although this script requires you to specify the number of pixels at the top.

The Code

Below is an example script which was used to do the basic cropping, which should be fairly self-explanatory. A more complex script was written to do the panning which follows the stair-climbing guy up the stairs, in order to create the illusion of continuity (on Muybridge's originals, he climbs up and then jumps back to the bottom of the stairs.



                    #!/bin/bash

                    

                    # edit only these variables

                    filename="../muybridge_wrestling.jpg"

                    let "across = 6"

                    let "down = 2"

                    let "width = 640"

                    let "height = 252"

                    

                    # these variables are derived

                    let "total=$across*$down"

                    let "panelwidth=$width/$across"

                    let "panelheight=$height/$down"

                    

                    panelx=0

                    panely=0

                    frame=0

                    

                    until [ "$frame" -eq $total ]

                    do

                    let "left=$panelx*$panelwidth"

                    let "top=$panely*$panelheight"

                    convert -crop "$panelwidth"x"$panelheight"+"$left"+"$top" $filename frame`printf "%03d" "$frame"`.jpg

                    let "frame=$frame+1"

                    let "scan = $frame % $across"

                    if [ "$scan" -eq 0 ]

                    then

                    panelx=0

                    let "panely=$panely+1"

                    else

                    let "panelx=$panelx+1";

                    fi

                    done

                    convert frame*.jpg anim.gif

                

Tagged:

work (8)

curiosity collective (6)

scripting (6)

zoetrope (4)

bash (3)

animation (2)

imagemagick (2)

muybridge