> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.agentchat.contrib.img_utils.pil_to_data_uri

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### pil\_to\_data\_uri

```python theme={null}
pil_to_data_uri(image: Image) -> str
```

Converts a PIL Image object to a data URI.<br />Parameters: <br />    image (Image.Image): The PIL Image object.<br />Returns: <br />    str: The data URI string.

<b>Parameters:</b>

| Name    | Description           |
| ------- | --------------------- |
| `image` | **Type:** Image.Image |

<b>Returns:</b>

| Type | Description               |
| ---- | ------------------------- |
| str  | str: The data URI string. |

<br />
