Can this be done better with the Raster class? Or some other way?

Printable View