Skip to main content

compress_jpeg

Function compress_jpeg 

Source
pub fn compress_jpeg(src: &NDArray, quality: u8) -> Option<NDArray>
Expand description

Compress an NDArray to JPEG.

Only supports UInt8 data. Handles:

  • 2D arrays (mono/grayscale)
  • 3D arrays with dims[0]=3 (RGB1 interleaved)

Returns None if the data type is not UInt8 or the layout is unsupported.