# window_from_bounds

```python
def window_from_bounds(
    geotiff: GeoTIFF,
    bounds: tuple[float, float, float, float],
    *,
    crs: str | int | CRS | Proj,
    require_fully_contained: bool = False,
) -> Window
```

Convert geographic bounds to an outward-rounded GeoTIFF pixel window clipped to the image.

This function requires Python 3.11 or newer and is imported from
`tilebox.storage.geotiff`.

## Parameters

**geotiff**

`GeoTIFF`

The open async-geotiff image.

**bounds**

`tuple[float, float, float, float]`

Coordinates in `(left, bottom, right, top)` order.

**crs**

`str | int | CRS | Proj`

The coordinate reference system of `bounds`.

**require\_fully\_contained**

`bool`

Whether to reject bounds that extend beyond the image instead of clipping
them. Defaults to `False`.

## Returns

An async-geotiff `Window` containing every pixel touched by the bounds.
