JulienMaille / dribbblish-dynamic-theme

A mod of Dribbblish theme for Spicetify with support for light/dark modes and album art based colors.
MIT License
334 stars 18 forks source link

Better color inference #217

Closed danbulant closed 2 years ago

danbulant commented 2 years ago

Is your feature request related to a problem? Please describe. Better colors (currently picks overly white or black colors)

Describe the solution you'd like I recently made an app that used auto color picking from image as well. A simple sort like (1-Math.abs(0.5 - c.luminance())) * ((a.length - i)/a.length) (c is the color from chroma, which is used here as well, i is index and a is array of colors) gives much better results. To explain, colorthief sorts the colors by most dominant to least dominant. However, covers often have large areas of black or white, which results in 'boring' colors set. Most colorful results are around 50% luminance (hence why the score here). Node vibrant uses this as well, but it ignores how common the color is (or maybe it does, but overly "boosts" vibrant colors), so this compensates for that by giving lower "score" to less common results.

The current algorithm seems to use colorthief and simply selects the first color that has luminance higher than 5% and lower than 90%, or uses the first color of no colors match the filter. My proposed solution should yield better or at least the same results.

Additional context Node vibrant kind of solves this as well, but as specified in other issues, it sometimes picks colors that aren't that common.

danbulant commented 2 years ago

Because of spicetify/spotify bug, it's hard to open DevTools right now, and I don't have time to correctly and thoroughly test the algorithm in dribbblish directly, hence why I didn't make this a PR instead.

JulienMaille commented 2 years ago

Because of spicetify/spotify bug, it's hard to open DevTools right now

https://github.com/spicetify/spicetify-cli/issues/1518#issuecomment-1106851885

danbulant commented 2 years ago

That didn't work for me. Using the logout and restarting spotify works, but is cumbersome and I have other things to do.