Add thumbnail-matching visualizer colors to a custom music player.
Study the algorithm as an example of hue analysis and Gaussian smoothing in C.
Adapt the technique to color other visual effects based on an image's dominant hues.
| tsoding/hue_stretch | dreamfekk/andriod_unrealmemorytools | freertos/backoffalgorithm | |
|---|---|---|---|
| Stars | 37 | 37 | 37 |
| Language | C | C | C |
| Last pushed | — | — | 2026-07-09 |
| Maintenance | — | — | Active |
| Setup difficulty | easy | hard | easy |
| Complexity | 2/5 | 5/5 | 2/5 |
| Audience | developer | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Only tested on Linux, running make then the compiled binary is the whole setup.
This repository holds a small algorithm called Hue Stretch, written to make a music player's visualizer change color based on whatever song thumbnail is currently playing. It was built for Sowon2, a custom music player the author uses to play tracks during breaks, and grew out of a live programming session where the author was streaming while coding. Originally the player's visualizer showed every hue in the rainbow at once with no relationship to the music. The author wanted the visualizer's colors to instead match the artwork of the song playing, so the algorithm looks at the thumbnail image, finds which hues appear most often in it, and stretches those hues across the color spectrum in proportion to how common each one is. A Gaussian blur is then applied to smooth the resulting colors into a clean gradient instead of harsh bands. The README includes before and after screenshots showing the visualizer going from a generic rainbow to colors that echo the song's cover art, along with a gallery of the effect applied to several different songs from the author's playlist, each with a link to the original track. To try it, you run a build command and then execute the compiled program. The README notes this has only been tested on Linux so far. All the technical detail of how the algorithm works lives directly in the hue_stretch.c source file rather than being explained further in the README itself.
A small C algorithm that colors a music visualizer to match the dominant hues in a song's thumbnail artwork.
Mainly C. The stack also includes C, Make.
License terms are not described in the README shown.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.