Open Collective
Open Collective
Loading
Releasing QuantiMat, this code takes down colors in image by 20x only 88ms...
Published on December 8, 2022 by A. Matias

QuantiMat (15.2kB minified 0 dep, only 3 kB with Gzip) is used for color quantization it can reduce an image with 50K colors down to 2K colors in 88ms with ease, 500K OPS (1 OP = distance + blending + ordering, ...) / SEC, we achieve one of the greatest quality, when you diminish initial colors 20 times, after processing you can't clearly see any differences except it also removes pixel color glitches and so enables a better quality. We achieve this speed thanks to SIMDope, but also thanks to sorting colors in either 4096, 256, or 16 clusters that takes a binary reduction of color component down to numbers from 0 to the number of cluster and this enables to not compare all of them to all of them savings millions of operations,