# How to make a color palette from an image ordered by frequence

**URL:** <https://discourse.processing.org/t/how-to-make-a-color-palette-from-an-image-ordered-by-frequence/4850>\
**Category:** Coding Questions\
**Created:** [October 25, 2018, 2:06am UTC](https://discourse.processing.org/t/how-to-make-a-color-palette-from-an-image-ordered-by-frequence/4850 "2018-10-25T02:06:12Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [October 30, 2018, 10:20pm UTC](https://discourse.processing.org/t/how-to-make-a-color-palette-from-an-image-ordered-by-frequence/4850/10 "2018-10-30T22:20:42Z")

</div>

I’ve done something similar in the past by using k-means to cluster the colors. Some posts that you might find interesting:

> [@Comic Book Colors](https://discourse.processing.org/t/comic-book-colors/1824):
>
> I recently put together a visualization that takes the first 100 pages of various comic books and shows the colors used by them. For example here is Saga: [image] And here is Pretty Deadly: [image] It’s really interesting to compare how different artists use colors, and how colors plays a role in the stories told by comic books. I used a combination of Processing and P5.js to put the visualization together. [Here](http://happycoding.io/gallery/comic-book-colors/about.html) is a discussion on the process, and [here](http://happycoding.io/gallery/comic-book-colors/code.html) is the code I used.

> [@Movie Color Visualization](https://discourse.processing.org/t/movie-color-visualization/2285):
>
> Inspired by my [comic book colors](https://discourse.processing.org/t/comic-book-colors/1824) project, I just put together a few visualizations of the colors used by various movies: So far I’ve played around with two different visualizations. The first one shows a movie as a [timeline](http://happycoding.io/gallery/movie-colors/timelines) of the colors used in each frame. For example here is Finding Nemo: The other visualization creates a [multiple exposure](http://happycoding.io/gallery/movie-colors/multiple-exposures) by combining every frame of a movie into a single image. Here’s Finding Nemo again: [Finding Nemo multiple exposure] A…

---

_[View the full topic](https://discourse.processing.org/t/how-to-make-a-color-palette-from-an-image-ordered-by-frequence/4850)._
