Could probably use this depending on the range. Rather than rasterize, subset by [::i]
[::i]
and
def filter_points(points, x_range, y_range): if x_range is None or y_range is None: return points return points[x_range, y_range] # add i here