Color quantization using octrees http://www.leptonica.org/papers/colorquant.pdf A Simple Method for Color Quantization: Octree Quantization https://link.springer.com/chapter/10.1007/978-3-642-83492-9_20 Octree Color Quantization https://www.cubic.org/docs/octree.htm https://www.codeproject.com/Articles/109133/Octree-Color-Palette Link: TreeStructure