D19392: shannon entropy to guess monochrome icon

Marco Martin noreply at phabricator.kde.org
Wed Feb 27 16:01:28 GMT 2019


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
  since we can't directly access the svg file, when we can't use
  KIconLoader try to detect monochrome icons on the actual image
  with the following heuristic:
  
  - less than 30% of pixels with high saturation
  - the Shannon entropy of the distribution of gray values of the
  
  non transparent pixels is less than 0.3
  this seems to give satisfying results with most icon temes

TEST PLAN
  tested with breeze, oxygen adwayta and some other themes from ghns

REPOSITORY
  R169 Kirigami

BRANCH
  mart/iconentropyheuristic

REVISION DETAIL
  https://phabricator.kde.org/D19392

AFFECTED FILES
  src/controls/BasicListItem.qml
  src/desktopicon.cpp
  src/desktopicon.h
  src/libkirigami/platformtheme.cpp
  src/libkirigami/platformtheme.h

To: mart, #kirigami
Cc: plasma-devel, domson, dkardarakos, apol, davidedmundson, mart, hein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190227/7a31e3ea/attachment.html>


More information about the Plasma-devel mailing list