Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

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

pyflink.multimodal.operators.image_metadata#

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

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

Accepts decoded Image values and encoded image bytes. For decoded input, mode reports the canonical Image mode and format is "UNKNOWN". For encoded bytes, metadata is read from the container header; corrupt bytes return None. Encoded-byte metadata is lightweight and does not guarantee that the full pixel stream can be materialized.

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.