Colors of The Dark Knight trilogy

Screen Shot 2013-09-14 at 15.00.30 Screen Shot 2013-09-14 at 15.37.13 Screen Shot 2013-09-14 at 16.14.32


These three images above show the average color of every single second of The Dark Knight trilogy.

In order to create them, I used ffmpeg to split up the movie into separate PNG files at a speed of 1 fps – representing one file per second. For each film there were around 8000 of these files.

I then wrote a simple Go program that would read each of the image files and calculate the average RGB values across the entire image. Thanks to Go’s concurrency patterns I was able to easily run 1000 of these tasks at once before generating the final images – my computer started to struggle running more than 1000 go routines at once, so it made sense to split it up into 1000 second blocks instead.

The whole project was reasonably easy to do and only took a few hours, and most of the processing time seemed to be ffmpeg rather than Go.

From the final images, I would say it is reasonably easy to discern which scenes are going on where if you are reasonably familiar with the movies.