pyflink.multimodal.codec.convert_image_array_to_mode#
- convert_image_array_to_mode(pixel_array, mode)[source]#
Convert an image ndarray to one of the built-in image modes.
Pillow performs the color/channel conversion. Bit-depth conversion between 16-bit and 8-bit modes uses the same linear scaling as Rust’s image crate:
uint16 // 257when reducing to 8-bit anduint8 * 257when expanding toL16.