Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
  • PyFlink Multimodal
    • Image
    • Video
    • Utilities
  • PyFlink DataStream
  • PyFlink Common

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. None uses 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"))

previous

pyflink.multimodal.operators.image_to_tensor

next

pyflink.multimodal.operators.image_resize

Show Source

Created using Sphinx 4.5.0.