# image_bytes_to_b64_string

> **Function** in `langchain_google_vertexai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-vertexai/_image_utils/image_bytes_to_b64_string)

Encodes image `bytes` into a b64 encoded string.

## Signature

```python
image_bytes_to_b64_string(
    image_bytes: bytes,
    encoding: str = 'ascii',
    image_format: str = 'png',
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `image_bytes` | `bytes` | Yes | `bytes` of the image. |
| `encoding` | `str` | No | Type of encoding in the string. (default: `'ascii'`) |
| `image_format` | `str` | No | Format of the image. (default: `'png'`) |

## Returns

`str`

B64 image encoded string.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/vertexai/langchain_google_vertexai/_image_utils.py#L244)