Function color_thief::get_palette [] [src]

pub fn get_palette(
    pixels: &[u8],
    color_format: ColorFormat,
    quality: u8,
    max_colors: u8
) -> Result<Vec<Color>, Error>

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.