quantize

fun QuantizerCelebi.quantize(image: ImageBitmap, maxColors: Int): Map<Int, Int>

Quantizes the colors in an ImageBitmap to a specified maximum number of colors.

Return

A map where keys are colors and values are their frequencies in the image.

Parameters

image

The ImageBitmap from which colors are extracted.

maxColors

The maximum number of colors to extract from the image. Fewer colors may be returned depending on the image content.