Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: [Request] Component to get a dominant color from album cover (Read 1818 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Request] Component to get a dominant color from album cover

Inspired by Mordred's Georgia Theme. In there, he changes the color of his theme based on the album cover.

According to him, he resizes the album cover to 200x200, then picks the dominant colors using the k-means algorithm. Then, based on the result, his config uses this color for the theme.

Would it be possible for anyone to make a plugin (something like foo_cover_color) in C++? Sadly, I'm not good enough for it, I can't even get the SDK to work (nor can I find any tutorials on how to do that, or how to write foobar plug-ins). The plugin should then output something like %cover_dominant_color% and %cover_dominant_color2% for the two most dominant (or up to five) colors in an image, to use them to dynamically change some colors in Foobar (for example, this should work with ESPlaylist, changing the color of the selection based on the album)

Alternatively, are there any tutorials on how to write foobar plugins, or any source code to view?

Re: [Request] Component to get a dominant color from album cover

Reply #1
Alternatively, are there any tutorials on how to write foobar plugins, or any source code to view?
Hi there,

You could browse the development forum right here. There is a pinned tutorial topic but I'm not sure how up-to-date it is(?). Here is a thread from 2008. I selected your text "tutorials on how to write foobar plugins" and right-click Google'd and go from there.

(Sorry it all reads like gobbledygook to me :D )

Really seems like it would be a lot of effort to change a few minimal colors though, seeing as the main window color of DUI (/ CUI)  is set by Windows system themes. (Like this Grey one)

Having said that I would probably like it myself ;)

Cheers

 

Re: [Request] Component to get a dominant color from album cover

Reply #2
Thanks for the reply! I'll check the tutorials out.

You're not necessarily right on the applications of the colors. Using Panel Stack Splitters it's possible to change the color of basically everything in Foobar, minus the top bar. This is my current theme: Spoiler (click to show/hide)

The dark grey you see is not provided by a Windows Theme (I'm running the default one), but by the components/PSS themselves. Furthermore, the color of the selection could be made a hue of the album color, as could be the control buttons. Basically whatever script has an option to input an RGB color via a number, and not a selection palette, could work with this, since instead of using rgb(120,120,120) you could use %album_color% or something, and the color would change dynamically.

In any case, I managed to dig up a tutorial on how to set up a f2k component project, hopefully I'll be able to code something.