Skip to main content

encode_image_gray

Function encode_image_gray 

Source
pub fn encode_image_gray(
    input: &[u8],
    width: usize,
    height: usize,
    config: &EncodeConfig,
) -> Result<Vec<u8>, EncodeError>
Expand description

Encode an 8-bit grayscale image. input is width * height luma bytes. The codestream declares a Gray color space, so the decoder emits a single-channel (L) image. Internally the luma is run through the XYB pipeline with R=G=B; the chroma channels are ~constant and cost almost nothing.