Show HN: High End Color Quantizer

https://news.ycombinator.com/rss Hits: 22
Summary

patolette is a C / Python color quantization and dithering library. At its core, it implements a weighted variant of Xiaolin Wu's PCA-based quantizer (not to be confused with the popular one from Graphics Gems vol. II, which is already available here). Some of its key features are: Avoids axis-aligned subdivisions Supports the CIEL*u*v* and ICtCp color spaces and color spaces Optional use of saliency maps to give higher weight to areas that stand out visually Optional KMeans refinement The library is still in need of a ton of improvements and most definitely not ready for production use, but it's already very useable. Installation A PyPI package is not yet available. Until then, installation is manual but it should hopefully be painless 馃 If you do face any obstacles building / installing, please submit an issue! 馃檹 Note for x86 patolette ships a slightly modified version of faiss to aid with an optional KMeans refinement step. You can use the CMAKE_ARGS environment variable to specify an instruction set extension for it to be built with. If your CPU supports any of the AVX extensions, you can drastically increase KMeans performance. For example, if your CPU supports AVX512 export CMAKE_ARGS= " -DOPT_LEVEL=avx512 " The following will build the wheel and install it in the currently active virtual environment. Linux (Debian) # Clone repository git clone https://github.com/big-nacho/patolette.git cd patolette # Install dependencies apt install libopenblas-openmp-dev libflann-dev # Optional: set OPT_LEVEL (check Note for x86 section) # Accepted values are "generic", "avx2", "avx512", "avx512_spr", "sve" export CMAKE_ARGS= " -DOPT_LEVEL=avx512 " # Build and install wheel pip install . Note on OpenBLAS: although any variant should in theory work, libopenblas-openmp-dev is recommended. If you have multiple variants installed, you may need to run the following before building for it to be linked properly. sudo update-alternatives --set libblas.so.3-x86_64-linux-gnu /usr/lib/...

First seen: 2025-06-10 13:23

Last seen: 2025-06-11 10:28