openFrameworks addon for extracting a color palette from an image using k-means clustering in L*A*B* color space.
README
ofxImageToPalette
OpenFrameworks addon for extracting a palette from an image. ofxImageToPalette uses k mean clustering to group similar pixels. Pixel distance measured in L\A\B\ color space. Converting images to palettes is not deterministic. Every time ``
getPalette()` is run on an image it will produce a differant output.
-------- 
Usage
Basic `c++ ofImage image; image.load("vangogh.jpeg"); std::vector<ofFloatColor> palette = ofxImageToPalette::getPalette(image,5,3); Save palettes to data folder
c++ std::vector<std::vector<ofFloatColor>> palettes; ofImage image; image.load("vangogh.jpeg"); palettes.push_back(ofxImageToPalette::getPalette(image,5,3)); ofxImageToPalette::savePalettes(palettes); Load palettes from data folder
c++ std::vector<std::vector<ofFloatColor>> palettes = loadPalettes(); Parameters
ofimage image int k` Controls how many colors will be in the final output. `int epoch` Controls how many k means clustering iterations will be run, higher values will return colors that are more washed out. `int imageResize` Image will be resized before being processed for performance. `bool useLabDistance`` If set to false color will measured with euclidean distance.
ofxAddons