DCP Project

The original image to be processed and two images that have gone image processing to reflect increased brightness and contrast, as well as greyscale image versions.

Awards All Round

Abstract: Image and video rendering is an extremely time consuming process requiring a great deal of compute power. This article presents an overview of Arnab Sagar’s application of distributed computing to image processing to expedite the process.

Behind the famed doors of the Walt Disney studio—doors usually barred to all visitors—more than seven hundred artists and musicians worked tirelessly to create  their unique experiment in entertainment: cartoon animation. Animatio, the latin word  meaning ‘to give life to’ is the apt idea that captures the essence of the end result.  

First an illustrator would render the scene and the characters, usually in black and white  pencil or charcoal on paper. Next, transparent celluloids were painstakingly painted  frame by frame by seasoned experts sitting side-by side in the studio. This work  requires that the grayscale imagery from the original renderings are brought to full  colour depth with just the right hue. It is vital to be consistent so that the end result  appears smooth and realistic. That is, as realistic as a cartoon needs to look! 

Today, simple off-the-shelf technology can be used to adjust colour and hue. As proof,  an intern at Distributive, Arnab Sagar set out to do just that. Unlike the Disney studios,  he uses a digital video that already exists: a close-up moment with a monarch butterfly.  The process involves extracting the frames one at a time and converting the frame  colour information into numbers (a typed Uint8 Array, specifically) for each pixel. Each pixel of every image is represented by numbers corresponding to colours in the visible  light spectrum. Math is done on each pixel to achieve different results. For instance, if you find the average colour value for a given pixel and assign that number to all the colour values, the result is a grey pixel. You will end up with a grayscale image if you do this for all of the pixels in an image. Likewise, brightness and contrast can be adjusted by similarly performing relatively simple math on the pixel colour values. 

Of course all this imagery and math takes a lot of time — regardless of whether a  human or a computer is doing it. In the case of the Disney studio back in the 1930s,  dozens of skilled illustrators worked at desks for long hours to reproduce the perfect  celluloid frames, altering colours as well as moving the animation forward. In this way,  the labour required to complete the thousands of frames was done in parallel by many  people to produce the cartoon drama. It still took months to complete a job that would  have taken years by a single artist. 

For Arnab, the butterfly frames get distributed using the Distributed Compute Protocol  (DCP). Each frame is sent to a separate computer processor to have the calculations  performed. Then the frames are sent back and stitched back together in order. Each  frame’s array of pixel colour data gets its colour adjusted as a professional production  studio would do and the end result is a striking animation with the desired adjustments.  

The startling thing about using the DCP is its power and ease of use. In Arnab’s case,  two things need to be done: the frames have to be cut apart and assembled into a set of  number groups; and, the desired math formula to adjust the colour has to be devised. 

Then, with this input set and work function it only takes three lines of code in the  javascript environment of any webpage to distribute the work! 

People with computer ‘workers’ around the world contribute computing resources to the  DCP computing network. A worker can be any computing device including the device  you are reading this piece on (thanks for making it this far!). People, institutions and  businesses do this to gain computing credits of their own as well as contribute to  science and research. 

Disney’s Snow White and Fantasia were created by artists sitting at desks in a parallel  formation, distributing the work of frame movement animation. Arnab’s animation was  transformed using devices working in parallel from around the world enabled by DCP.  Disney won academy awards with both of the mentioned projects. For Arnab, the  butterfly intern project is certain to win “best short DCP-enabled colour-adjusted video  award”. Congratulations all! 

—dstewart Q2 22

Arnab Sagar
Developer @ DCP
Arnab Sagar is a fourth year student at the University of Guelph, majoring in CS and minoring in Statistics. Sagar’s major interests are development using the web stack, systems programming, and automation. The Distributive software developer’s goals for the year include contributing more to open source, pursuing an independent research project, and making music.
Douglas Stewart
Director of Special Projects @ DCP
Douglas Stewart is an eclectic innovator that has cofounded numerous companies from construction to grocery to software—including Distributive! With a great love for travel and music, you can always count on Doug for an exciting tale to tell about the places he’s visited or catch him playing guitar downtown with a local gypsy-jazz trio.