Raster Window Extractor

Sentinel-2 Scene (10,980 x 10,980 px)
# Extract subset without loading entire file
subset = src.read(1, window=Window(
    col_off=2500,
    row_off=2500,
    width=4000,
    height=4000
))
RAM Required (single float32 band) 61.0 MB
Memory Management: A standard 10m Sentinel-2 tile is exactly 10,980 x 10,980 pixels. Reading just one band into a 32-bit float array consumes about 460 MB of RAM (or nearly 2 GB for a 4-band stack!). By passing a Window object to .read(), Rasterio only extracts the exact bounding box of pixels you requested, keeping memory overhead minimal.