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_metadata#

image_metadata(*columns, concurrency=None)[source]#

Extract metadata (width, height, channels, mode, encoded format) from an image.

mode reports the image’s channel/precision mode: Pillow’s mode string for raw encoded bytes, or the canonical mode ("L", "LA", "RGB", "RGBA", "L16") for decoded Image input. format describes the encoded container for raw bytes. For decoded Image input it is "UNKNOWN" because the internal pixel value intentionally does not retain original encoding metadata. Apply format filters to raw encoded bytes before image_decode when the original container format matters.

Parameters
  • *columns – Optional image columns. When provided, the UDF is applied directly (syntactic sugar).

  • concurrency – UDF concurrency. None uses the framework default.

Returns

A UDF producing an object with width, height, channels, mode, and format fields.

Example::
>>> # As a reusable variable
>>> metadata = image_metadata()
>>> df = df.with_columns("meta", metadata(col("img")))
>>>
>>> # Inline
>>> df = df.with_columns("meta", image_metadata(col("img")))

previous

pyflink.multimodal.operators.image_remove_background

next

pyflink.multimodal.operators.image_aspect_ratio

Show Source

Created using Sphinx 4.5.0.