scale_to_uint8#

scale_to_uint8(array: Union[ndarray, MaskedArray], perc: int = 2) Union[ndarray, MaskedArray][source]#

Rescale array (read as rasterio arrays, which means the bands are the first dimension) to uint8. 0 will be the nodata.

Parameters:

arr (numpy array) – Array to rescale

Returns:

Rescaled array from 0 to 255 saved in uint8

Return type:

numpy array