Removed memory copies from toRaster