Just a bit of an update: Turns out the each_with_index iterator is INSANELY slow on ruby1.8 on large arrays, so I had to use each_index instead and pixels[i] instead of pix. Still a happy ending though! Chris -- Posted via http://www.ruby-forum.com/.