daft.functions.decode_image#
decode_image #
decode_image(bytes: Expression, on_error: Literal['raise', 'null'] = 'raise', mode: str | ImageMode | None = RGB) -> Expression
Decodes the binary data in this column into images.
This can only be applied to binary columns that contain encoded images (e.g. PNG, JPEG, etc.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bytes | Binary Expression | image to decode. | required |
on_error | str, default="raise" | Whether to raise when encountering an error, or log a warning and return a null | 'raise' |
mode | str | ImageMode | None, default=ImageMode.RGB | What mode to convert the images into before storing it in the column. By default, images are decoded as RGB. If this is set to None, the mode will be inferred from the underlying data. | RGB |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Image Expression | An expression representing the decoded image. |
Source code in daft/functions/image.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |