diff --git a/roofsense/annotation/exporters.py b/roofsense/annotation/exporters.py index 9444f34..3237f62 100644 --- a/roofsense/annotation/exporters.py +++ b/roofsense/annotation/exporters.py @@ -1,10 +1,27 @@ +import os +from typing import Any + import numpy as np import rasterio.plot -def to_png(data: np.ndarray, path: str): +def to_png( + data: np.ndarray[[Any, Any, Any], np.dtype[np.number]], + filepath: str | bytes | os.PathLike, +) -> None: + """Export the RGB bands of the input raster to a PNG file. + + Args: + data: + The input raster. Must contain at least three bands in the RGB configuration. + filepath: + The destination filepath. + + Returns: + None + """ with rasterio.open( - path, + filepath, mode="w", count=3, height=data.shape[1],