Last active
March 18, 2021 13:08
-
-
Save duhaime/61a776980471bec1224f2e2e79514aaa 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