Function exoquant::convert_to_indexed [] [src]

pub fn convert_to_indexed<D, O>(image: &[Color], width: usize, num_colors: usize, optimizer: &O, ditherer: &D) -> (Vec<Color>, Vec<u8>) where D: Ditherer, O: Optimizer

A convenience function to simply quantize an image with sensible defaults.

Examples:

let (palette, indexed_data) = convert_to_indexed(&image.pixels, image.width, 256,
  &optimizer::KMeans, &ditherer::FloydSteinberg::new());