Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Pigment

This is simple tool which uses the K-means++ algorithm to pick suitable terminal colors from a given image. The algorithm is an approximation for solving clustering/paritioning problems, which in this particular case means finding N = 8 dominant colors in the image. Obviously, it does not work well on pictures with narrow spectrum.

To set colors in Pantheon terminal (Elementary OS), simply invoke the following

./pigment.py [image filename]

Currently, the code only works in Pantheon terminal, but the colors can be extracted and manually inserted into your favorite terminal's settings. Running the script for the image below...

we get the following set of colors:

Another example is as follows:

To tweak the colors, you can set beta and gamma to increase general brightness and decrease background brightness, respectively.

About

🎨 A tool program to set terminal colors from image

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages