# image_output

Python API: `depthai_nodes.node.parsers.utils.image_output`

## Functions

| Name | Description |
| --- | --- |
| [`compute_image_output`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/image_output.md#image_output-Functions-compute_image_output) | Convert a model image tensor to an 8-bit image array. |

### function `compute_image_output`

```python
def compute_image_output(output_image: np.ndarray) -> np.ndarray
```

Convert a model image tensor to an 8-bit image array.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `output_image` | `np.ndarray` | CHW or HWC tensor, optionally preceded by a singleton batch dimension. | required |

Returns

| Type | Description |
| --- | --- |
| `np.ndarray` | A uint8 array with the same channel layout as the unbatched input. Values are min-max scaled to [0, 255]; constant tensors become zero. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the tensor is not 3D after removing a singleton batch dimension. |
