Updated code to write ppm files instead; gets better performance without loss and can be stitched easily into a movie