Color Pallete from Image Generator

made this small project to automatically gather colors from my wallpaper and generate a terminal theme using those colors. right now it generates a kitty terminal configuration and you can access it through the theme config file variable. i am aware of the different programs that do the same thing but pywal (a color scheme generator) wasn't giving enough contrast between the different colors so I wrote my own.

to change the image to something else just import a new image into the Image Processor sprite. you can change the contrast in the code but it's not obvious where to change the values as of now. there's a few bugs that need to be fixed (like if the image doesn't have enough colors the color pallete will be black) but for the most part it works fine. the colors seem a little bland but they look fine for me.

results (using kitty as terminal)

https://snap.berkeley.edu/snap/snap.html#present:Username=joecooldoo&ProjectName=Theme%20Generator

Interesting.

Why the 10% stretch?

I think if I were to try something like this I'd start by converting the colors to HSL. It's mainly the hues you care about, right?

I only need a general idea of the colors in the image. i figured that if I went through every pixel in the image it would take a lot longer.

down the road when I change my wallpaper again and change the colors of my desktop, I will improve it more. right now it gets the most common colors and adjusts them so that everything is readable on a dark background and text is readable if the foreground and background are changed by a terminal program (for example, the zsh prompt in my terminal containing my username and hostname)

Oh! I'm losing my mind; I thought that meant a 10% increase; it never occurred to me that you were making such a huge change. Got it. :~)

The built-in "Frequency distribution" library is quite effective.
For the color range compressed by 25, full image analysis took ~2.5s.