Skip to content

tsoding/hue_stretch

Repository files navigation

Hue Stretch Algorithm

An algorithm we use in our music player to adapt the colors of the visualizer to the thumbnails of the currently playing songs.

screenshot 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:

hue_stretch_off

We decided to make it adapt to the colors of the thumbnals:

hue_stretch_on

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.

Quick Start

Tested only on Linux so far.

$ make
$ ./hue_stretch

Gallery

Here is a gallery of how this algorithm works on a bunch of songs we have in our playlist.

hmister_catalyst Song: H-Mister - Catalyst


hmister_moving_forward Song: H-Mister - Moving Forward


hmister_read_set_action_2021_edition Song: H-Mister - Ready Set Action! 2021 Edition


hmister_steadfast Song: H-Mister - Steadfast


ko0x_essential_facts_of_life Song: ko0x - Essential Facts of Life


nu11_break_n_enter Song: nu11 - Break & Enter


nu11_face_your_destiny Song: nu11 - Face Your Destiny


nu11_melt_my_heart Song: nu11 - Melt My Heart


nu11_strike_forward Song: nu11 - Strike Forward

About

Hue Stretch Algorithm we use in Sowon2 to adapt the color of the visualizer to the thumbnails of the currently playing songs

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages