mart created this revision. mart added a reviewer: Kirigami. Herald added a project: Kirigami. Herald added a subscriber: plasma-devel. mart requested review of this revision.
REVISION SUMMARY ImageColors is a class to extract color statistics out of an image. it supports as source : - Grabbing a static frame out of any Item - A QImage or a QIcon (for instance coming from a QAbstractItemModel - An icon name from the theme By a pixel-by pixel analisys it uses a K-means clustering algorythm https://en.wikipedia.org/wiki/K-means_clustering that groups averages of colors group that have a computed "distance" less than an arbitrary value and so extracts a palette of the "dominant" colors of the image, having also other imformations such as the % occurrence of each cluster, a complementary color for each cluster, the global average color, the most "vibrant" color of the image, usable as an accent, and good colors for text and background, based on the extracted palette REPOSITORY R169 Kirigami BRANCH mart/imageColors REVISION DETAIL https://phabricator.kde.org/D29637 AFFECTED FILES src/CMakeLists.txt src/colorutils.cpp src/colorutils.h src/imagecolors.cpp src/imagecolors.h src/kirigamiplugin.cpp tests/imagecolorstest.qml To: mart, #kirigami Cc: plasma-devel, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, ahiemstra, davidedmundson, mart