# image

Python API: `depthai_nodes.message.creators.image`

## Functions

| Name | Description |
| --- | --- |
| [`create_image_message`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/creators/image.md#image-Functions-create_image_message) | Create an ImgFrame from an integer image array. |

### function `create_image_message`

```python
def create_image_message(
    image: np.ndarray,
    is_bgr: bool = True,
    img_frame_type: dai.ImgFrame.Type = dai.ImgFrame.Type.BGR888i,
) -> dai.ImgFrame
```

Create an ImgFrame from an integer image array.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `image` | `np.ndarray` | Non-empty CHW or HWC image with one or three channels. When both layouts are plausible, a leading size of 1 or 3 selects CHW. Floating-point image values are rejected. | required |
| `is_bgr` | `bool` | Whether three-channel input is BGR. False converts RGB input to BGR. | `True` |
| `img_frame_type` | `dai.ImgFrame.Type` | Requested DepthAI frame type. Grayscale input switches to GRAY8 unless the requested type begins with RAW or GRAY. | `dai.ImgFrame.Type.BGR888i` |

Returns

| Type | Description |
| --- | --- |
| `dai.ImgFrame` | Image message with payload, dimensions, and frame type set. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If neither channel layout is recognized or the image contains floating-point values. |
