-
-
Save mastdiekin/c0341b3c94fb2dc57549356763742162 to your computer and use it in GitHub Desktop.
Color thief top colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from colorthief import ColorThief | |
import matplotlib.pyplot as plt | |
import numpy as np | |
color_thief = ColorThief('cat.jpg') | |
palette = color_thief.get_palette(color_count=8) | |
arr = np.array(palette).astype(float) / 255 | |
plt.imshow([arr]) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment