Chronic Film
A nearly eternal algorithm
A collaboration with Alex Anikina to create a movie that encapsulates Every Image that will ever exist.
The wildly shortened version of the story is that it combinatorially iterates through every color channel (0-255) for every color channel (Red Green and Blue) for every pixel on the screen, with the original presentation being 720p. That means every frame of every movie that will ever be made, every photograph that will ever be taken, every view of YOUR life from every angle with every variation, etc etc.
How it works
So after looking around for a calculator that won’t overflow when it runs out of integers, we can calculate the length of this wonderful silent-film:
That’s uh... about 2 with 100 million zeros after it. Seems like an appropriate length for the omnifilm.
The main way it does this in realtime is by treating all the channels of all the pixels as a stack of arrays with 256 values.
For the sake of visual interest, we also shuffled each array instead of iterating linearly from 0 to 255.
Another way to visualize this algorithm is as a clock with 1280 * 720 hands. Just as the minute hand clicks once each time the second hand makes one trip around the clock, each array shifts over once each time the previous array shifts 256 times.
This is where we run into problems. We have to calculate when to shift each array. Those numbers get B I G. Like...
Really big.
This project was built in javascript for the sake of portability. I know, I know, we should use rust, but this was 2016. Things were different then. 😛
We tried several BigInt libraries to handle these numbers. All of them tanked the FPS of the video to sometimes less than a frame per second. We had to make a decision between the algorithm being correct and it being good art (meaning interesting enough to watch to make a statement).
We decided in the end to let the integers overflow for now. The visual result is largely the same, and the budget (of time and energy as well as money) at the time didn’t really allow for solving major computing problems like that.