# get_image_from_path

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/media_utils/get_image_from_path)

Read and encode an image file from disk.

## Signature

```python
get_image_from_path(
    path: pathlib.Path,
) -> ImageData | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `path` | `pathlib.Path` | Yes | Path to the image file. |

## Returns

`ImageData | None`

`ImageData` when the file is a valid image, otherwise `None`.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1ae053f347679e58562d2b81eb6d6e6e9bbf0b07/libs/cli/deepagents_cli/media_utils.py#L126)