Class KMeansQuantizer
java.lang.Object
net.sourceforge.plantuml.quantization.KMeansQuantizer
- All Implemented Interfaces:
ColorQuantizer
Uses k-means clustering for color quantization. This tends to yield good
results, but convergence can be slow. It is not recommended for large images.
-
Field Summary
Fields -
Method Summary
-
Field Details
-
INSTANCE
-
-
Method Details
-
quantize
Description copied from interface:ColorQuantizer
Quantize the given set of colors, returning a set no larger thanmaxColors
.The intent is to pick a set of colors which are representative of the original color set, but no specific guarantees are made.
- Specified by:
quantize
in interfaceColorQuantizer
- Parameters:
originalColors
- the colors in the original imagemaxColorCount
- the maximum number of colors to allow- Returns:
- a quantized collection of colors no larger than
maxColors
-