An explanation of this year’s stocking stuffers
In my last blog post, I demonstrated that one could extract the dominant/most common colors in a .jpeg
using \(k\)-means clustering to create a color palette, which I skillfully randomized to create thematic art.
Here, I’ll show the source images and the resulting art I’ve made.
A compilation I made:
The initial color palette (with \(k = 30\) clusters):
The curated color palette with modified weights and removed colors:
The initial color palette (with \(k = 30\) clusters):
The curated color palette:
The initial color palette (with \(k = 30\) clusters):
The curated color palette with modified weights and removed colors:
The initial color palette (with \(k = 50\) clusters):
The curated color palette:
Left: the original image taken in New Hampshire in Fall 2021. Right: an edited version of the image removing many of the brown tones – my goal was to provide the color spirit of the experience.
The initial color palette (with \(k = 50\) clusters):
The curated color palette (regrettably, a nice orange did not appear in the \(k = 50\) clustering, although it did appear in the \(k = 100\) clustering I tried. I should have used bind_rows
in retrospect):
The initial color palette (with \(k = 50\) clusters):
The curated color palette:
And we can even see who/what each of these colors belong to (below). The skin tones end up making the art look weird, so I removed them as well.
The initial color palette (with \(k = 50\) clusters):
The curated color palette:
There are two color palettes below, the first with \(k = 99\) and the second with \(k = 149\) (both with the border grey color removed). We can compare the first 99 clusters (colors) of both palettes and see that the former color palette ends with a few brown shades that are simply the average of the rare colors, while the latter is more vibrant.
Using the \(k = 150\) clusters, we can examine a few palettes with the first 110, 120, 130, and 140 colors: