I came to this hackathon not knowing what exactly to make, only that I wanted to use the Spotify API and some kind of image processing with OpenCV. What I ended up producing is more of an art project, the finds the average color of a chunk of pixels, and finds the closest match in a local repository of album art to make a pretty mosaic!


I ended up downloading the album art from musicbrainz, an online database of all things music (song titles, years, metadata, etc.). This is taking up about 500MB or half a gigabyte of data on my computer. Storing the images this way is much better for speed and making less API calls when the script is running. Because this image processing app is running on a few year old laptop, I had to think a lot about efficiency and storing things in sensible ways. This also included cleaning data with Powershell scripts, running tens of command prompts running a python script at the same time with a batch file.


The "official" python API implementation listed on Spotify's website was very outdated, and the API itself has changed so that this library doesn't work. I ended up finding an open source, and well-kept Python web API for Spotify that worked great. Since I'm running an image processing app, it's fairly computing intensive. Being that this is running and crunching a lot of numbers, I have to limit the resolution that I can make the mosaic out of, and it still takes a good amount of time to run.

Built With

Share this project: