improve rasterize script