# image2utf8 (function)

## Syntax

```python
def image2utf8(image: PIL.Image) -> str:
```

## Parameters

`image`

The `image` parameter is expected to be a PIL (Python Imaging Library) image object. It will be converted to RGB format and then encoded as a base64 string with a JPEG format prefix. The resulting string will be returned as UTF-8 encoded text.

## Return value

A string representation of the input image in UTF-8 format, encoded in base64. The string includes a prefix indicating that the image is in JPEG format.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://openadapt.gitbook.io/openadapt.ai/reference/api-reference/openadapt-module/utils.py/image2utf8-function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
