Function color_thief::get_palette
source · [−]pub fn get_palette(
pixels: &[u8],
color_format: ColorFormat,
quality: u8,
max_colors: u8
) -> Result<Vec<Color>, Error>
Expand description
Returns a representative color palette of an image.
-
pixels
- A raw image data.We do not use any existing image representing crate for a better portability.
-
color_format
- Represent a color format of an underlying image data. -
quality
- Quality of an output colors.Basically, a step in pixels to improve performance.
Range: 1..10.
-
max_colors
- A number of colors in the output palette. Actual colors count can be lower depending on the image.Range: 2..255.