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

image_rescale(*columns, scale, method='lanczos', concurrency=None)[source]#

Rescale an image by a multiplicative factor, preserving aspect ratio.

Each dimension is scaled by scale and rounded to the nearest pixel (minimum 1).

Parameters
  • *columns – Optional image columns. When provided, the UDF is applied directly instead of returning a factory.

  • scale – Positive scale factor. 0.5 halves each dimension; 2.0 doubles them.

  • method – Resize interpolation method — "lanczos" (default), "bilinear", "bicubic", or "nearest". Accepted case-insensitively and normalized to lowercase.

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

Returns

A UDF producing decoded image values.

Example::
>>> # As a reusable variable
>>> rescale = image_rescale(scale=0.5)
>>> df = df.with_columns("small", rescale(col("img")))
>>>
>>> # Inline
>>> df = df.with_columns("small", image_rescale(col("img"), scale=0.5))

previous

pyflink.multimodal.operators.image_resize

next

pyflink.multimodal.operators.image_crop

Show Source

Created using Sphinx 4.5.0.