viz.joint_rgb
viz.joint_rgb(r, g, b, lo=2, hi=98)Joint-percentile stretch across three bands -> (H, W, 3) RGB.
A joint stretch picks one (p_lo, p_hi) range from the union of all three input bands and applies the same transform to each. The alternative – stretching each band separately – flattens each channel to the same dynamic range and destroys the relative brightness between B02, B03 and B04 (so water that was originally bluer than redder ends up grey on the screen). The joint stretch preserves true relative intensity so water reads blue, vegetation green, urban grey.
NaN pixels are returned as white (1.0) so masked / out-of-AOI areas are obvious instead of vanishing into a black background.