pyflink.multimodal.operators.image_convert_mode#
- image_convert_mode(*columns, mode, concurrency=None)[source]#
Convert an image to a target mode.
- Parameters
*columns – Optional image columns. When provided, the UDF is applied directly instead of returning a factory.
mode – Target image mode, e.g.
"RGB","RGBA","L", or"L16". The image is converted to this mode before output.concurrency – UDF concurrency.
Noneuses the framework default.
- Returns
A UDF producing decoded image values.
- Example::
>>> # As a reusable variable >>> convert_mode = image_convert_mode(mode="L") >>> df = df.with_columns("gray", convert_mode(col("img"))) >>> >>> # Inline >>> df = df.with_columns("gray", image_convert_mode(col("img"), mode="L"))