integrate tool with the library so far
palette conversion
make kmeans stateless