KMeans Clustering for Dominant Color

Hey @NEWP_Official - matthew here. I was off the grid for a few days with some pieces. Which version of TD are you using, and what’s your version of python that’s installed on your machine?

UPDATE

Looking more closely, what you caught there was actually an issue with the save() method for TOPs, the keyword arg was changed to asynchronous instead of async. I’ve updated the dev and main branch of the repo. Try pulling the latest tox out of the release folder and see if that works for you.

1 Like

@raganmd it is possible for you make KMeans Clustering for Dominant Color with scriptTOP?

Regard
Jacobi

I’m sure you could swap to using the Script TOP these days - back when I first made this component that TOP didn’t yet exist. It is important to know that Python is blocking in TouchDesiger, and the KMeans approach if used in a ScriptTOP would block the main thread until it completed. That’s probably okay for some use cases, but if you were trying to find it on the fly it’d cause some stuttered playback. There are ways to do this without blocking, it just usually means the results are delayed.