Skip to content

Tool made for generating cool song graphics from HTML using the Spotify API. Uses K-Means to extract colors.

License

Notifications You must be signed in to change notification settings

Gtruaan/SOTD-Graphics-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOTD-GENERATOR 🧙‍♂️

What?

This is a tool to generate cool instagram story sized graphics for song tops and highlights.

How?

The tool produces your graphic through the following steps:

  • Searches for the song using the Spotify API
  • Downloads the album art
  • Performs color preprocessing (changes color space)
  • Performs K-Means clustering to find dominant colors
  • Generates a graphic using a gradient of dominant colors and the album art
  • Screenshots from a headless browser

Why?

It's cool. Check out the results:

Top number: 15
Search track: Weird Fishes

Graphic for Weird Fishes / Arpeggi by Radiohead

Top number: 4
Search track: Is She Weird Pixies

Requirements

pyppeteer
spotipy
io
os
asyncio
json
requests
sklearn
numpy
pillow
matplotlib

Additional requirements

  • pyppeteer (Python Puppeteer port) requires a chrommium browser to be installed.
  • Perform setup of a Spotify application to access the API. See Spotify for Developers.
  • Update spotify_credentials.json with your own credentials.

Notes

  • You can change the number of dominant colors and gradient structure by editing n_colors and the css file in assets respectively.
  • You can edit the HTML file freely
  • This project is very personal and it might not be suited as a general purpose tool as of now.

TODO

  • Better CLI (it sucks right now ☠)
  • Non-hardcoded gradient
  • Better color preprocessing
  • Better way of generating the image from the HTML

About

Tool made for generating cool song graphics from HTML using the Spotify API. Uses K-Means to extract colors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published