Skip to main content

rgba_to_rgb

Function rgba_to_rgb 

Source
pub fn rgba_to_rgb(rgba: &[u8], width: u32, height: u32) -> Vec<u8> 
Expand description

Drop the alpha channel of a tightly packed width * height RGBA8 buffer, returning tightly packed width * height RGB8 (3 bytes per pixel).

silx’s raster image export (PlotImageFile.saveImageToFile) operates on an (h, w, 3) RGB array; the PPM body carries RGB, so the readback’s RGBA is reduced to RGB by discarding alpha.