vrt.create_rgba_vrt()

Create a 4-band uint8 RGBA VRT colour-mapping a raster through lookup tables.

Usage

Source

vrt.create_rgba_vrt(
    src_path,
    output_vrt,
    *,
    luts,
    src_bands=(1, 1, 1),
)

Each colour band reads one source band through its own piecewise-linear LUT. Alpha is 255 except at NODATA, which is skipped and so stays at the band’s zero initialisation – transparent, letting a tiler drop empty tiles.

Parameters

src_path: str | Path | UPath

Source raster; may be a VRT.

output_vrt: str | Path | UPath

Output VRT.

luts: Sequence[Sequence[tuple[float, int]]]

One table per colour band: (source value, output 0-255) pairs, in ascending source order.

src_bands: Sequence[int] = (1, 1, 1)
Source band each of R, G and B reads. (1, 1, 1) colour-maps one single-band raster; (1, 2, 3) maps the three bands of an RGB source.

Raises

ValueError
If luts or src_bands does not hold exactly three entries.