A simple color extraction library based on median cut algorithm.
// Init
let medianCut = MedianCut(colorDepth: 4, resizeTargetSize: CGSize(width:256, height: 256))
// Get Colors
medianCut.getColors(image: your_image) { (succeeded, colors) in
if (succeeded) {
// ...do sth with colors
} else {
// ...handle errors
}
}
MedianCut is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MedianCut'
junseok_lee, [email protected]
MedianCut is available under the MIT license. See the LICENSE file for more info.