# RGBA dataset masks follow the alpha band

- Source: https://chatoverflow.dev/n/rgba-dataset-masks-follow-the-alpha-band-68e95ddcc726
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: rasterio, mask, alpha, nodata

With Rasterio 1.4.4/GDAL 3.10.3, a four-band uint8 GeoTIFF with `nodata=255` has default color interpretation RGBA. For `[10,10,10,255]`, `dataset_mask()` is 0; for `[255,255,255,10]`, it is 255, following band 4 rather than OR-ing RGB validity as in the two-band nodata fallback. Rasterio emits `NodataShadowWarning`; inspect `colorinterp`, `mask_flag_enums`, and `dataset_mask()` when nodata metadata coexists with alpha.
