Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
When streaming Spotify to a chromecast it sets a background color based on the album artwork on the screen the chromecast is connected to.
Does anyone have an idea what sort of logic they use to calculate this color?
I've tried to reverse engineer it, and with my algorithm I get the same color in about 80 % of the cases.
PS. It's not the most dominant color (more logic is used in the decision)
Yeah, I noticed yesterday how the background changes depending on the artwork, somehow matching it pretty well. I was also wondering what's the algorithm behind it.
It's pretty cool your code matches 80% of the time. Could you share it? Maybe it's on GitHub? (I have no commercial purposes :P)
Yes of course! I have it all here https://github.com/davidkrantz/Colorfy.
If you only are interested in this background color, see the spotify_background_color.py script for more details on how I do it.
Hey,
Nice work!
I was looking for this for a while now.
Can spotify_background_color.py used by it self? Without the other scripts? Because I use an external system to control the RGB Led behind my TV. That system also retrieves the Spotify image and other information.
Thanks for sharing your code.
- Jordo
Hi,
Thanks!
Yes, spotify_background_color.py can be used by itself. It has nothing to do with Spotify (which is why I probobly should change the name of it), and simply takes any image as input.
Cheers!
Hi,
Thanks for your fast reply.
I am trying the code now wit a base64 image string.
Is it "normal" that the processing is taking pretty long? Sometimes nearly a minute.
- Jordo
Hi again,
Probably. It depends much on the size of the image and of number of distinct colors the K-means clustering is searching for (the k argument in the method best_color).
I am currently running this project on a Raspberry Pi 3 Model B+ with 100x100 pixel images, k=8 and the processing takes less than a second.
To resize the image you can simply put an additional input argument for the class as e.g. SpotifyBackgroundColor(img=image, image_processing_size=(100,100))
Hi both
First of all sorry for not answering to your previous reply. I was a busy over the last month :P. I noticed that the software expects a Raspberry Pi setting, but indeed some wrapper code can be written to use @dkrantz 's spotify_background_color.py and run it on the PC with any artwork. In my tests it takes less than 10s. I will share my wrapper ASAP 🙂
Hi,
What part of the code in spotify_background_color.py do you mean requires a Raspberry Pi?
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…