The `return await` is not necessary, as an async function will always return a Promise. Note that you can `await img.decode()` to get rid of the onload handler.
To skip an intermediate array this could also be written as:
```
colorScores = Array.from(result.entries(), ([c, s]) => ({ score: s, color: c }))
.sort((a, b) => b.score - a.score)
```
Thank you for you insightful comments, I made some improvement to the cells in this notebook. However, this variable should be named colorPopulation as the value reflects the cluster size (aka color population) in the image. I've made a separate cell using the scoring library function.