Color quantization using octrees