Skip to content

Instantly share code, notes, and snippets.

View joseluisrt's full-sized avatar

Jose Luis de la Rosa joseluisrt

  • YSEngineers, S.L.
  • Malaga, Spain
View GitHub Profile
@zollinger
zollinger / getcolor.py
Last active March 11, 2023 15:57
Simple way to get dominant colors from an image in Python
from PIL import Image, ImageDraw
import argparse
import sys
def get_colors(image_file, numcolors=10, resize=150):
# Resize image to speed up processing
img = Image.open(image_file)
img = img.copy()
img.thumbnail((resize, resize))