Y'all have got to check out the color palette widget wizardry of David Aerne. Seriously, the guy's prolific. The first link is similar to OP's, an image color palette extractor:
Very cool. Looks very nice. I have a small utility that I made for myself and just added your algo to it: https://github.com/wkoszek/imgstat -- palette looks much better to what I had before.
This might be the best color palette generator I’ve ever seen. I used to work in Operating Systems, and trying to get a good color palette from a photo is HARD. A lot of very smart very well paid people have dedicated years of their life to this type of thing. Really fantastic work.
If the author of the blog post ever comes across this thread/ comment, bravo and I hope you feel pride in your work and I’d go so far to say discovery.
Agreed - I remember implementing colour quantisation in MATLAB at university and it seemed simple enough, though we only used it for some simple cases (to learn the theory more than anything). Looking at some of the example images there it looks like it's easy to hit edge cases.
I agree with the kudos, but back when I was an interesting person and in early 2000s I stumbled on this same/similar approach of using K-means clusters with LAB color space for a painting algorithm I was using in my masters project. RGB was not effective.
Have you ever tried allrgb.com? The idea is to use every 24-bit RGB triplet once and only once. Many people naturally choose 4096x4096 as the final image size.
Y'all have got to check out the color palette widget wizardry of David Aerne. Seriously, the guy's prolific. The first link is similar to OP's, an image color palette extractor:
https://okpalette.color.pizza
https://meodai.github.io/RYBitten
https://rybitten.space
Very cool. Looks very nice. I have a small utility that I made for myself and just added your algo to it: https://github.com/wkoszek/imgstat -- palette looks much better to what I had before.
This might be the best color palette generator I’ve ever seen. I used to work in Operating Systems, and trying to get a good color palette from a photo is HARD. A lot of very smart very well paid people have dedicated years of their life to this type of thing. Really fantastic work.
If the author of the blog post ever comes across this thread/ comment, bravo and I hope you feel pride in your work and I’d go so far to say discovery.
Can you talk a bit more on what makes this hard from your experience/pov, asking as someone who doesn't have much experience with this type of work
Agreed - I remember implementing colour quantisation in MATLAB at university and it seemed simple enough, though we only used it for some simple cases (to learn the theory more than anything). Looking at some of the example images there it looks like it's easy to hit edge cases.
I agree with the kudos, but back when I was an interesting person and in early 2000s I stumbled on this same/similar approach of using K-means clusters with LAB color space for a painting algorithm I was using in my masters project. RGB was not effective.
Related from same author: Generating a color spectrum for an image https://news.ycombinator.com/item?id=47783062
This is cool, I’m going to try write my own implementation to follow along as a learning exercise
Interesting design choices.
Have you ever tried allrgb.com? The idea is to use every 24-bit RGB triplet once and only once. Many people naturally choose 4096x4096 as the final image size.