pyflink.multimodal.codec.image_to_ndarray#
- image_to_ndarray(image, mode=None)[source]#
Return decoded
Imagepixels as an ndarray for operator internals.When
modeisNone, this returns the stored Image data unchanged, including its canonical 3-D(height, width, channels)shape. Callers may rely on this 3-D HWC shape; single-channel decoded images must not be collapsed to 2-D in themode=Nonepath. When a target mode is provided, Pillow handles color/channel conversion and the codec applies linear 8-bit/16-bit scaling. Single-channel targets such asLandL16are returned in Pillow’s 2-D array shape.