Finding the dominant color of an image in an Android @drawable

后端 未结 8 848
情深已故
情深已故 2020-11-28 20:42

You can understand why I\'m trying to find the dominant color in an image if you use Windows 7. When your mouse over a program in the taskbar, the background of that partic

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 21:17

    Loop through all the pixel's color data and average the color values, ignore anything that is a shade of grey or transparent. I believe that is what Microsoft does in Windows 7 based on a recent blog post.

    edit
    The blog post: http://blogs.msdn.com/b/oldnewthing/archive/2011/12/06/10244432.aspx

    This link showing how Chrome picks the dominant color may also be helpful. http://www.quora.com/Google-Chrome/How-does-Chrome-pick-the-color-for-the-stripes-on-the-Most-visited-page-thumbnails

提交回复
热议问题