An algorithm we use in our music player to adapt the colors of the visualizer to the thumbnails of the currently playing songs.
Thumbnail is taken from nu11 - FamiTracker Works album. Artwork by Yomieda.
This algorithm was developed on a Live Programming Session for Sowon2 - a custom music player we use to play cool tracks during the breaks. The player originally had a visualizer that was colored in all hues of the color spectrum like a rainbow:
We decided to make it adapt to the colors of the thumbnals:
The algorithm analyses the most frequent hues of the thumbnail and stretches them on the color spectrum proportinally to their frequencies. The resulting color sequence is then smoothed out with Gaussian Blur to create a nice gradient. For all the technical details see ./hue_stretch.c.
Tested only on Linux so far.
$ make
$ ./hue_stretchHere is a gallery of how this algorithm works on a bunch of songs we have in our playlist.
Song: H-Mister - Catalyst
Song: H-Mister - Moving Forward
Song: H-Mister - Ready Set Action! 2021 Edition
Song: H-Mister - Steadfast
Song: ko0x - Essential Facts of Life
Song: nu11 - Break & Enter
Song: nu11 - Face Your Destiny
Song: nu11 - Melt My Heart
Song: nu11 - Strike Forward

